> Note that what you are saving by combining the files into one is just a
> single stat syscall per file.  And that can be alleviated by setting
> apc.stat=0 in your config.  That of course means you need to restart
> your server or flush your cache whenever you want to update the files.
> In apc.stat=0 mode you gain nothing by merging all the files.
> 
> -Rasmus

This was our belief as well but we have been experimenting with file
combining and have seen as much a 2x speed improvement over using includes
even with apc.stat=0.

I need to spend some time investigating this more but from some initial
profiling the most significant difference is that when all functions are in
a single file execution goes through ZEND_DO_FCALL_SPEC_CONST_HANDLER. When
functions are in included files execution seems to go through
ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER and
ZEND_INIT_FCALL_BY_NAME_SPEC_CONTS_HANDLER. The latter function spends a
good amount of time in zend_str_tolower_dup and overall we spend more time
in memory allocation.

I'm not too familiar with zend internals and do not yet undersand the logic
here but today there is an actual benefit to inlining files when working
with a large enough code base.

-lucas

--
[EMAIL PROTECTED]
[EMAIL PROTECTED]

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to