Hi!

Another option may be to compute a hash of the file.  When you find
that file content has the same hash value as a known file you flag
them as "same file".  This could be faster (file contents are cached

First, two files with the same content is not the same as same file referred twice with different name. Second, to know that I'd need to open and read the whole file and then compute the hash of it - which sounds quite expensive. Right now with proper caching non-including include_once can be done with 0 system calls (unfortunately, pure PHP doesn't do it yet, though IIRC Zend's Optimizer+ does - not sure about APC).

in main memory because the OS already knows the files are the same,
and finding the "real" name of a file is a slow process).

It's only slow process once, then it's cached. And I'm not sure it's faster to load all the file into memory then check it's path.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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

Reply via email to