Due to overwhelming public demand (Mike and Steve), I have 
completed the exercise of merging my pirate parrot with the latest
CVS version, and added a few additional features:
Constant strings are now COWed
The memory pool used by strings and buffers is now managed on
   a paged basis, rather than a single block.
Compaction is halted if the free space in a newly allocated 
   page exceeds a given threshold (currently set to 70%)
The calls to free_unused_foo have been removed from DOD run,
   and are instead called only when a specific header pool is empty.
compact_pool will free any dead buffer headers it encounters.

A few random numbers^W^Wbenchmark results follow:
Benchmark         CVS  Grey  Grey+s/w
5000 lives        124   74     84
hanoi 14           50   33     34
reverse jit_cpu.c  25   22     22

Grey+s/w refers to a version of grey with one tuning amendment,
to reduce the number of DOD runs, plus activation of the stack
walking code. Now that grey is competitive speedwise even with
stack walking, I will see if I can somewhat reduce its memory
usage.

This patch uses #ifdef African_Grey all over the place, primarily
to make it easier to find the changes. Theoretically you should be 
able to delete the define, and compile a pure version; I have never 
actually tested this. In addition, there is a GREY_INTERP macro,
used to insert interpreter as an argument to a few functions that
now require it. Following Steve's suggestion, strstart is defined
as bufstart.

All tests pass with GC_DEBUG=0; three fail with GC_DEBUG=1,
due to bugs in the index op in core.ops (string_to_cstring returns
highly volatile pointers)
I have not done a full audit for cycle counter wrap problems yet,
so long-running programs may experience difficulties.
-- 
Peter Gibbs
EmKel Systems

Attachment: grey3.patch
Description: Binary data

Reply via email to