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 #179141 is a reply to message #179140] Fri, 14 September 2012 19:41 Go to previous messageGo to previous message
Eli the Bearded is currently offline  Eli the Bearded
Messages: 22
Registered: April 2011
Karma:
Junior Member
In comp.lang.php, J. Frank Parnell <juglesh(at)gmail(dot)com> wrote:
> I have my 'funcs' dir, full of about 120 files, totaling ~800KB. A
> bunch of little utility functions. Here is basically how i include
> them:
....
> So, my question is, am I saving a significant amount of ram/cpu/time by
> keeping this cache of filenames or should I just glob the dir and
> include what's in there everytime?

The glob for a directory with 120 files will be nothing compared to
the time it takes php to include() 800KB worth of stuff. You might
want to consider only including what you really need. That will be
the bigger win.

Elijah
------
glob on a very big directory (multiple thousands of files) is different
[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: Fri Sep 20 09:21:13 GMT 2024

Total time taken to generate the page: 0.05112 seconds