FPS, ForeignPtr and GHC 6.6

Simon Marlow simonmarhaskell at gmail.com
Fri Apr 21 07:44:17 EDT 2006

Bulat Ziganshin wrote:
> Friday, April 21, 2006, 2:09:36 PM, you wrote:
>>Just did some benchmarking of FPS with ghc 6.6 from last night.
>>Most functions seem to have gotten faster (due to the improved ForeignPtr). In particular:
> it's the answer what will be the speed using ByteArray#. ForeignPtr in
> ghc 6.6 is no magic, it just contains direct Ptr instead of boxed one
> in 6.4

The point is that you can't implement all the operations in FPS using a 
ByteArray# representation, so that's a bogus comparison.  ForeignPtr is 
the right thing!

BTW, we could improve the performance of ForeignPtr even further by 
eliminating the IORef in its representation.  This means losing the 
ordering property of addForeignPtrFinalizer, but if we did this just for 
the ForeignPtrs created by FPS.pack, I doubt anyone would ever notice, 
and you save 12 (24) bytes per PS.


More information about the Libraries mailing list