You are here: Re: OPTIMIZING - The fastest way to open and show a file « PHP « IT news, forums, messages
Re: OPTIMIZING - The fastest way to open and show a file

Posted by Ruben Rubio Rey on 10/10/39 11:29

In a "almost idle desktop machine" always takes arround 0.04.

The measured is on a server when it was with low traffic (average load
arround 0.7)

ac wrote:

>where did these time measured?
>on a heavily loaded server or on your own almost idle desktop machine ?
>
>
>On 10/14/05, Ruben Rubio Rey <ruben@rentalia.com> wrote:
>
>
>>Hi,
>>
>>I m creating a cache system, and i have a problem: PHP takes a lot of
>>time opening the file. (Im using 2.6.9-1.667smp and XFS)
>>
>>* For files less or equal 6 Kb, takes arround 0.02-0.03 miliseconds - its
>>ok
>>* For files arround 35 Kb takes arround 0.2-0.4 miliseconds - too much.
>>
>>What can I do to make faster opening files?
>>
>>**************************************************************
>>Source code:
>> if(file_exists($filename)){
>> $modified_date=filemtime($filename);
>> if(time()<($modified_date+1 * 24 * 60 * 60)){
>> $handle = fopen($filename, "r");
>> $contents = fread($handle, filesize($filename));
>> fclose($handle);
>> echo $contents;
>> }
>> }
>>**************************************************************
>>
>>Thinks that I have tried:
>>* fopen is *much* faster than include
>>* filemtime is faster than filectime
>>* Pear Cache its too much slower (0.5-0.7 milsecond per file)
>>
>>Thanks in advance
>>Tk421
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>>
>
>
>--
>all born, to be dying
>
>
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация