[Haskell-cafe] Optimization with Strings ?
gcross at phys.washington.edu
Thu Dec 3 14:13:20 EST 2009
You might want to check out the "stringtable-atom" and "bytestring-trie" packages; these are the packages to which I turn when I want to see if I can speed up my code by using a different data structure to map String's to values.
On Dec 3, 2009, at 4:03 AM, Emmanuel CHANTREAU wrote:
> In my futur program, it use a lot of binary trees with strings (words)
> as leaf. There is just arround 1000 words and they will appear a lot of
> times. The program will possibly consume a lot of process and memory
> (it is a mathematics proover).
> I began this program in C++ but haskell has a prety good speed and
> memory footprint and is easier. But I don't know if it worth to do this
> optimization: having a dictionary to translate string words in Int.
> The answer depends on the automatic optimizations in GHC, because GHC
> could compare quickely two strings if it is the same object, so it
> depends if program generated by GHC have a dictionary (tree) of strings
> internaly. Someone knows this ?
> (Sorry for my english, I'm french)
> thank you
> Emmanuel Chantréau
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe