> Admittedly, when opening the file for the first time, we do not need to
> seek - so we can avoid it by passing a flag (OR'd with the REPORT_ERRORS
> flag).
> 
> I'm sure we can eliminate those seeks.  Are there any other areas in the
> streams code that you can see that could do with a syscall tune-up?

Those are the only ones I have seen so far that stood out as being 
extraneous.  

I think we should do our best to add whatever shortcuts are necessary to
ensure the most common execution path is as fast as we can possibly get
it.  If it takes getting a little ugly passing in flags, so be it.  I'd
like to get 4.3 up to the same level as 4.2.  I still need to hack and
slash away code for Yahoo! on top of that since syscall thrashing is our
limiting factor at this point.

There is other ugliness hiding in there.  For example, include_once on a 
file that has already been included will still stat() (many times) and 
open() the file.  Only later on does it go and check the included_list to 
see if it should actually have done that.  Not quite on the primary 
execution path, but still.  If you have a case where that scenario happens 
a lot, it is actually mesurably faster to do manual multiple include 
prevention with a PHP-level flag.  The _once stuff was added distinctly to 
prevent that kind of ugly code, but we stuffed it up.

-Rasmus


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

Reply via email to