Re: How expensive is glob'ing a dir and including all the files? [message #179163 is a reply to message #179162] |
Sun, 16 September 2012 21:45 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 9/16/2012 1:50 PM, J. Frank Parnell wrote:
> Ok, so I tested via:
> function microtime_float(){
> list($utime, $time) = explode(" ", microtime());
> return ((float)$utime + (float)$time);
> }
> $script_start = microtime_float();
> require '_funcs/_funcs.php';//this file does the globing, cacheing, including
> $script_end = microtime_float();
> echo "Script executed in ".bcsub($script_end, $script_start, 4)." seconds." ;
>
> and I got
> Script executed in 0.0200 seconds
> Thats with either globing or reading the cache file (which backs up the statement that the glob doesnt add much)
>
That's a HUGE amount of server time!
> Afa size and traffic of sites, wordpress sites, plenty of plugins and custom stuff. Traffic, some might be 100-500 page views/day.
>
> Testing script execution for the whole page gave me around 2.5 seconds.
>
Even worse!
> The whole front page takes around 2 seconds
Not good at all.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|