Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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

In reply to Re^3: Things every perl programmer should know? (faster?) by tye
in thread Things every perl programmer should know? by licking9Volts

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [harishnv]: hey

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (6)
    As of 2018-02-18 11:00 GMT
    Find Nodes?
      Voting Booth?
      When it is dark outside I am happiest to see ...

      Results (253 votes). Check out past polls.