Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^3: Things every perl programmer should know? (faster?)

by tye (Sage)
on Jun 05, 2003 at 14:15 UTC ( #263339=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Things every perl programmer should know? (faster?)
in thread Things every perl programmer should know?

Thanks. It is nice to have some numbers and some corroboration. 3 seconds is almost shockingly slow to just read 10000 filenames and compare to a glob string. Especially since I thought Perl is using C code for this (taken from some well-respected free shell implementation, I think).

I also appreciate the "I'd do it with glob [... unless] embedded in a library", which matches my thinking on the subject (except that I think glob can probably be "fixed" and so I might even use glob in a library based on that expectation).

So I'm still curious why glob is so slow. I'm not sure when I'll find the time/motivation to investigate further (probably comparing built-in glob vs. File::Glob, File::DosGlob, and my own File::KGlob and verifying some of my own assumptions).

I'm also still interested in seeing numbers from the original poster. It sounds like you would see less than 2 seconds difference in run time in a similar situation. I have a hard time characterizing 2 seconds as an "impressive" difference, but I've seen such characterizations made based on the ratio of run times so that might be the whole story. But it could also be that licking9Volts was seeing a much bigger difference.

                - tye
  • Comment on Re^3: Things every perl programmer should know? (faster?)

Replies are listed 'Best First'.
Re^4: Things every perl programmer should know? (faster?)
by jdporter (Canon) on Jul 31, 2007 at 16:10 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://263339]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2018-01-23 01:10 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (238 votes). Check out past polls.