[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GC improvements
From: |
Ludovic Courtès |
Subject: |
Re: GC improvements |
Date: |
Wed, 04 Jan 2006 17:18:22 +0100 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
Hi Han-Wen,
Thanks for your input!
Han-Wen Nienhuys <address@hidden> writes:
> the easiest way is to modify
>
> scm_gc_for_newcell()
>
>
> so it directly passes to the
>
> scm_i_get_new_heap_segment (freelist, abort_on_error);
>
> case
No, that won't have any impact because this very case is rarely
reached.
I checked this by adding two (static) counters to `scm_gc_for_newcell ()':
one that counts the number of calls, and one that counts the number of
non-EOL returns of the first `scm_i_sweep_some_segments ()' call. The
ratio (still for the same workload) is _always_ very, very close to 1.
This is because `scm_i_sweep_some_segments ()' does not actually only
sweep segments: it sometimes (actually here, most of the time)
*initializes* them. The reason is that it uses `scm_i_sweep_some_cards ()'
which in turn chooses whether to initialize or sweep depending on
whether the segment at hand is already initialized (SWEEPER is chosen
based on SEG->FIRST_TIME).
This interleaving of initialization and sweeping makes it pretty hard to
track exactly where fresh cells come from. I guess one solution might
be to maintain a list of the uninitialized segments and pick cells
directly from there before actually sweeping.
To be continued... Hopefully! ;-)
Thanks,
Ludovic.