Daniel Molina Wegener wrote:

> On Sunday 28 November 2010,
> Larry Garfield <la...@garfieldtech.com> wrote:
> 
>> There are many things that everybody "knows" about optimizing PHP
>> code. One of them is that one of the most expensive parts of the
>> process is loading code off of disk and compiling it, which is why
>> opcode caches
>> are such a bit performance boost.  The corollary to that, of course,
>> is that more files = more IO and therefore more of a performance hit.
> 
>   It depends on the implementation that PHP uses to open the file. For
> example on Linux and similar operating systems, PHP uses the mmap(2)
> function instead of read(2) or fread(2) functions, so it maps the
> complete file into memory, that is more faster than using partial file
> reads.

I doubt if a read(file,1Mb) and an mmap(file,1Mb) will be very
different.  The file has got to be hauled in from disk regardless of
which function you choose. 



-- 
Per Jessen, Zürich (2.6°C)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to