FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How expensive is glob'ing a dir and including all the files?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
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 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  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
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: php and PDO Error HTTP 500
Next Topic: PHP Update
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 20:10:50 GMT 2024

Total time taken to generate the page: 0.03489 seconds