Re: REMINDER - stream wrappers in include_path

From: Date: Mon, 24 Mar 2008 13:28:00 +0000
Subject: Re: REMINDER - stream wrappers in include_path
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-36423@lists.php.net to get a copy of this message
Dmitry Stogov wrote: > Hi Greg, > > In your second patch you forgot "break", so it couldn't work. > I don't see any reason in second patch at all, because you call > php_resolve_patch() from _php_stream_open_wrapper_ex() anyway. > > The bad thing with the first part that it calls realpath() function > twice for each include("relative_path.php") and it makes several > file-system accesses (look into strace ... 2>&1| grep > lstat). With > your patch I see 6 syscalls more. > > So I would prefer my patch that is more efficient for regular files. > The same patch with fixed white-spaces is attached. Your patch is broken, it causes an endless loop in tests/include_path.phpt when running phar tests. Incidentally, I was unaware of the strace command (I've seen it bandied about on irc, but thought it was something else), so thank you for edumacatin me there. The attached patch has no additional syscalls over the current case for both existing and non-existing files, and actually works for phar as well :). It's also simpler (I removed the include stuff from zend_vm_def.h), although you may want to add it back in and bench it to see if it makes any difference in performance, since I found such a dramatic reduction in operations here with it. Greg

« previous php.internals (#36423) next »