Re: Disk IO performance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel Molina Wegener wrote:

> On Sunday 28 November 2010,
> Larry Garfield <larry@xxxxxxxxxxxxxxxx> 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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux