preliminary FastString-Map results

Isaac Dupree isaacdupree at charter.net
Wed Aug 15 11:29:57 EDT 2007


About a 0.5% penalty on speed and bytes allocated.  This is with 
replacing the internal FastString hashtable with a (Data.Map.Map PtrStr 
FastString)
where data PtrStr = PtrStr {-#UNPACK#-}!ForeignPtr {-#UNPACK#-}!Int
with the inefficiency of copying bytes to a ForeignPtr in order to do 
the Map-lookup, even if the string is already found in the table.

Not an acceptable replacement for GHC (yet), might be reasonable for 
other implementations... which might end up using [Char], not Addr#, for 
string literals, as an additional significant change, further into 
unexplored territory!

A trie might be more appropriate but they're less available, and 
FiniteMap is not very available either due to module import loops 
(FiniteMap imports quite a bunch of other GHC stuff!).  Any ideas how 
any of these could be reasonably usable?

Isaac



More information about the Cvs-ghc mailing list