[MLton-devel] Minimizing heap copying

Alain Deutsch deutsch@polyspace.com
Fri, 23 Aug 2002 15:04:59 +0200 (MET DST)


There are a few places where the active heap is moved around. For
instance in resizeHeap the entire active heap is copied if
grow=true.

I observed during self-compiles that garbage collections which do
go through this copying are typically close to 2 times more costly
than the plain ones. Furthermore, these GCs with extra copying are
not so infrequent: I measured 9 of them on a total of 50 GCs on a
self compile.

I was wondering if this copying could perhaps be avoided
completely using the mremap() system call ?

void * mremap(void * old_address, size_t old_size ,
              size_t new_size, unsigned long flags);  

A rough account of the potential speedup based on the data above
is 50/(9*2 + 41) = 0.84 (or 15% on the GC time).

--
Alain Deutsch, CTO              tel.: +33 (0)1 49 65 32 64
PolySpace Technologies          fax.: +33 (0)1 49 65 05 77
mailto:deutsch@POLYSPACE.COM    http://www.polyspace.com



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel