[Haskell] performance tuning Data.FiniteMap

MR K P SCHUPKE k.schupke at imperial.ac.uk
Tue Mar 2 12:58:58 EST 2004


I was thinking about improving array performance, and was wondering
if a transactional model would work well. You would keep a base copy
of the array, and any writes would be written to a delta style transaction
list. A reference to the array would be the list plus the base array.
Different references to the same array would just reference different
points in the delta list. The garbage colector would eat the delta list
from the tail, merging writes into the base array once references to
that part of the list are discarded. Writes would be very fast - just 
the time to add a delta to the transaction list. Reads would slow down
as the transaction list grows, but the list would only be as long as the
oldest reference, so providing references to very old copies of the    
array are not required, the transaction list would remain short. It would
be even more efficient if the 'liveness' of references could be checked
when writing the array - at the cost of a slight slowdown in write 
performance.

I would be interested in any comments... I suspect somebody has done this
before, but I havent looked for any papers yet.

	Regards
	Keean Schupke.


More information about the Glasgow-haskell-users mailing list