[MLton-devel] mutator card-marking costs
Stephen Weeks
sweeks@sweeks.com
Fri, 23 Aug 2002 11:59:51 -0700
> Here are the results of comparing MLton 20020728 with my current
> working version, where the the generational GC is hardwired off. So,
> the only difference between compiling -generational true and
> -generational false is that the mutator does card marking (and the GC
> allocates the cardmap). There is only one benchmark, vector-concat,
> where the card marking really hurts -- and that makes no sense, sadly,
> because in vector-concat it is integer arrays being concatenated.
> I'll look into that one.
...
> MLton0 -- /usr/local/bin/mlton
> MLton1 -- mlton -generational false
> MLton2 -- mlton -generational true
>
> run time ratio
> benchmark MLton1 MLton2
...
> vector-concat 1.0 1.4
...
> size
> benchmark MLton0 MLton1 MLton2
...
> vector-concat 31,459 36,331 36,331
(note, -generational is now called -mark-cards)
I finally figured this one out. vector-concat does no pointer
assignments, so there is no card marking code in the mutator, as one
might guess from the code sizes. The slowdown is due to cache
effects. With -mark-cards true, the gc doubles the bytes requested in
anticipation of the possibility that the nursery may be halved to make
space for minor gcs. Of course, with a small heap and a high live
ratio, this will never happen. This doubling pushes the heap size
from 200K to 400K, which is enough to put some stuff outside the
cache.
I have fixed the problem by having the gc not do the doubling, and
instead check before it splits the nursery in half to make sure there
is enough space. That took care of the problem. There are no
remaining performance problems on any benchmarks.
-------------------------------------------------------
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