Hi David, Isn't finding cycles an NP-complete problem? :) How can you know there are no cycles without actually looking for them?
It would definitely be nice to be able to turn this feature on/off at runtime. The majority of pages in PHP don't require such a feature but it's a good thing for us to have (I've looked into this quite a bit in the past). As for the additional if() statements you can try and use branch prediction hinting to the compiler in order to keep the non-gc version fast. Btw, one of the challenges I found in the past is knowing which hash tables to actually traverse because some variables/hash tables in PHP are saved outside the symbol tables. Are you really successful in traversing all of them? Are you saving their addresses during allocation? If so, how do you know they are intact when you traverse? Do you start traversal only when we're supposedly in a stable state? (re-entrancy problems?) Also the additional size of zval can be quite an issue. In fact, with the whole 16bit->32bit transition we made for refcount we reduced performance. Maybe we can figure out a creative way to keep this down? Do you mind posting a patch against your baseline to make it easier for us to look at your work? This can end up being a good thing if we manage to make it work well. The problem with this stuff though is that the last 5-10% is 95% of the work :) Thanks for the effort! Andi > -----Original Message----- > From: David [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 12, 2007 6:35 PM > To: 'Scott MacVicar' > Cc: Stas Malyshev; 'Sebastian Bergmann'; internals@lists.php.net > Subject: RE: [PHP-DEV] Mid-term Update for Cycle Collector > (Google Summer of Code Project) > > > Could the garabage collector be started / stopped during script > > executing from a userland function? zend_gc_enable/disable() in > > addition to an ini option to enable it at script startup? > > Yes, that functionality can be added fairly easily. Some GC > code will still have to be executed (such as the if branches > that currently check whether the GC is enabled or not :-)) > but performance may increase slightly (since there will no > longer be a function call for the GC to note down possible > cycles it detects). However, a drastic performance increase > will probably not be seen. It's very unlikely for the main > garbage collection cycle to be run if there are no cycles > present. (I can go into some technical details if you'd like). > > David > > -- > PHP Internals - PHP Runtime Development Mailing List To > unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php