
Hello Guys, I tried my own version of PackedStrings and the results are very nice. It is entirely based on ByteArray# and Int#. I have made two tests:
--import StringUtils.PackedString as PS import Data.FastPackedString as PS
main = test1 [] 1000000 --main = test2 [] 1000000
test1 xs 0 = return () test1 xs n = let x = PS.pack ("*****" ++ show n ++ "*****") in x `seq` test1 (x : xs) (n-1)
test2 xs 0 = return () test2 xs n = let x = PS.concat [PS.pack "*****", PS.pack (show n), PS.pack "*****"] in x `seq` test2 (x : xs) (n-1)
The detailed statistics are attached. Basically the results are: Elapsed time | | FastPackedString | PackedString | +-----+------------------+--------------+ |test1| 99.26s | 3.81s | |test2| 175.88s | 5.28s | Maximum Memory Residency | | FastPackedString | PackedString | +-----+------------------+--------------+ |test1| 40.60Mb | 36.25Mb | |test2| 91.58Mb | 33.94Mb | My PackedString implementation is attached too. Cheers, Krasimir