AW: AW: [PHP-DEV] Garbage collector patch
| From: | Matthias Pigulla | Date: | Wed, 05 Dec 2007 20:16:33 +0000 |
| Subject: | AW: AW: [PHP-DEV] Garbage collector patch | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-33770@lists.php.net to get a copy of this message | ||
> > Is it possible to always perform (unconditionally compile in) the
> > necessary housekeeping tasks but stick with the current GC, so that
> > cycle-detection only happens when the user calls a
> > gc_go_find_cycles()
> > function? Would that significantly improve the above numbers?
>
> Yes, that would be possible, but it wouldn't speed anything up in case
> you don't have any cycles.
Not sure I got you right. That is, the speed penalty comes from housekeeping? Does the new GC try to
find cycles automatically whenever a refcount goes down to zero?
If building and maintaining data structures for the algorithm costs only a little memory but speed
impact is neglegible unless the algorithm actually runs, then you could stick with the
non-cycle-detecting "legacy" GC (= speed) unless you know you have cycles and/or want to
trade a little processing time (a call to gc_go_find_cycles()) for the memory it will/might free.
-mp.