[Haskell-cafe] FPS lib
simonmar at microsoft.com
Wed Oct 19 06:31:11 EDT 2005
On 19 October 2005 01:08, Donald Bruce Stewart wrote:
> However, on my machine:
> OpenBSD/Pentium-M 1.6G/ghc-6.5 -O
> Elapsed time: FPS Simon's PackedString
> Krasimir's test1 1.966s (40M) 2.151s (36M)
> 2.235s (36M) test2 6.048s (24M) 3.160s (73M)
> 2.318s (39M)
> Which is basically what I expected. Though perhaps I need to improve
> concat (we currently do things a little strangely in concat, due to
> the darcs legacy), but pack itself is nice and fast.
> Linux/Pentium 4 3.6G/ghc-6.4.1 -O
> test1 35.37s 30.97s 2.180s
> test2 90.93s 60.55s 1.916s
> Ah!! So what's going on on Linux, I wonder. Could it be something
> 6.4.1? Are we seeing the difference between ForeignPtrs from 6.4 to
> 6.5? I will investigate.
I bet that's the difference between ForeignPtrs in 6.4.1 and 6.5. I'm
very tempted to merge the ForeignPtr optimisations into 6.4.2, so we can
benefit from this earlier. The changes are all confined to one module
BTW, concat isn't optimised in my library. It's defined like this:
concat pss = pack $ Prelude.concat $ Prelude.map unpack pss
which is why I'm not winning this benchmark :)
> I'd be very wary of switching entirely to non-portable ghc
> primop-based code, as FPS already run ons hugs and I think nhc.
Yes, I think the benchmarks will ultimately show that using ByteArray#
isn't worth much, if any, performance gain.
More information about the Haskell-Cafe