RE: [Haskell-cafe] FPS lib

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 about 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 (GHC/ForeignPtr.hs). 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. Cheers, Simon

2005/10/19, Simon Marlow
On 19 October 2005 01:08, Donald Bruce Stewart wrote:
Ah!! So what's going on on Linux, I wonder. Could it be something about 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 (GHC/ForeignPtr.hs).
I made my benchmarking with ghc-6.5 and I am getting relatively the same result as with ghc-6.4.1. I checked that the optimized ForeignPtr implementation is in my source tree. Any thoughts? Cheers, Krasimir

kr.angelov:
2005/10/19, Simon Marlow
: On 19 October 2005 01:08, Donald Bruce Stewart wrote:
Ah!! So what's going on on Linux, I wonder. Could it be something about 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 (GHC/ForeignPtr.hs).
I made my benchmarking with ghc-6.5 and I am getting relatively the same result as with ghc-6.4.1. I checked that the optimized ForeignPtr implementation is in my source tree. Any thoughts?
Ok, rerunning the test you posted with only the compiler version varying (so, just the FPS ForeignPtr code on OpenBSD x86, Pentium M 1.6G). With ghc 6.4.1 test1: 121.10s test2: 252.11s And with ghc 6.5 test1: 2.006s test2: 6.112s Wow, ForeignPtr was slow with 6.4.1! -- Don
participants (3)
-
dons@cse.unsw.edu.au
-
Krasimir Angelov
-
Simon Marlow