On Sat, 24 Apr 2004, George Schlossnagle wrote: > A nitpick - apc now uses device/inode information and not the file name > as hash keys. It's no less or more expensive before, both require an > equivalent of realpath() (actually in the apache case the new version > is twice as efficient as the old - thanks rasmus).
What do you mean by that? APC doesn't require anything near a realpath. If you get rid of realpath() in PHP, APC will work just fine. With my syscall hacks I am using APC this way and I just have 1 stat per file. The only visible difference is when you ask APC which files it has cached and it doesn't return full-path filenames but rather just the paths used to include the files. For the top file there is no stat in PHP/APC at all anymore as we inherit the stat struct from Apache (which I guess is what you are alluding to) and then for each include file only a single stat is needed. That is nowhere near the equivalent of a realpath which adds N stats per file where N is the depth of the file in the directory structure. If you are really crazy and want the equivalent of this without hacking PHP you would make / your doc_root and put all your files there. And every include would do include ./filename. That would get close. There are still a couple of stray stats in there that aren't strictly needed. There is one in the streams code as well that I hacked out. -Rasmus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php