Karl, good catch. Given the statistics of the corpus that I use (~ 350 directories compare to ~ 65,000 files), I didn't expect much difference, but I did get a surprise. Adding $rule->file made PIR (both iter and iter_fast) much slower than the alternatives! (FYI, this is using the Benchmark::Forking version of the program).

                  Rate  PIR PIR fast File::Find perl readdir find pipe iter find pipe
PIR            0.622/s   --     -36%       -67%         -77%           -88%      -89%
PIR fast       0.975/s  57%       --       -48%         -64%           -82%      -83%
File::Find      1.89/s 205%      94%         --         -31%           -64%      -67%
perl readdir    2.74/s 342%     181%        45%           --           -48%      -53%
find pipe iter  5.32/s 757%     446%       181%          94%             --       -8%
find pipe       5.80/s 833%     495%       206%         111%             9%        --

Cheers, lbe


In reply to Re^2: Performant Path Iteration by learnedbyerror
in thread Performant Path Iteration by learnedbyerror

Title:
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, details, 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, summary, 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.