Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Comment on

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

Thanks. That clears things up. (Well mostly:).

The answer appears to be something to do with the fact that Win32::Sleep() is a built-in masquerading as an autoloaded module "export".

That is to say, you don't have to do use Win32; prior to using Win32::Sleep().

However, if you do use Win32;, then do the profiling, you get just:

================ SmallProf version 2.02 ================ Profile of test-p.pl + Page 1 =============================================================== +== count wall tm cpu time line 0 0.00000 0.00000 1:#! perl -slw 0 0.00000 0.00000 2:use strict; 0 0.00000 0.00000 3:use Win32; 0 0.00000 0.00000 4: 0 0.00000 0.00000 5:sub aaa { 5000 4.93252 0.00000 6: Win32::Sleep( 1 ); 0 0.00000 0.00000 7:} 0 0.00000 0.00000 8: 0 0.00000 0.00000 9:sub bbb { 500 4.99202 0.00000 10: Win32::Sleep( 10 ); 0 0.00000 0.00000 11:} 0 0.00000 0.00000 12: 0 0.00000 0.00000 13:sub ccc { 50 4.99873 0.00000 14: Win32::Sleep( 100 ); 0 0.00000 0.00000 15:} 0 0.00000 0.00000 16: 0 0.00000 0.00000 17:sub ddd { 5 4.99969 0.00000 18: Win32::Sleep( 1000 ); 0 0.00000 0.00000 19:} 0 0.00000 0.00000 20: 0 0.00000 0.00000 21:sub eee { 10 0.00008 0.00000 22: aaa() for 1 .. 1000; 10 0.00008 0.00000 23: bbb() for 1 .. 100; 10 0.00008 0.00000 24: ccc() for 1 .. 10; 10 0.00008 0.00000 25: ddd() for 1 .. 1; 0 0.00000 0.00000 26:} 0 0.00000 0.00000 27: 2 0.00001 0.00000 28:eee() for 1 .. 5; 0 0.00000 0.00000 29:

I do mean "just". Without the use, it profiles all of the usual things strict; warnings; Dynaloader; Autoloader; Config; Carp; Cwd; etc. etc.

But by adding use Win32;, all of that profile trace vanishes, and you get just the above output. Which is cool in a weird sort of way (or weird in a cool sort of way:), but has the bonus that now the counts are as expected.

Not totally satisfactory as an explanation in as much as it opens another bunch of questions -- like: why does strict.pm et al no longer get traced? (Regardless of whether the use strict; comes before or after the use Win32; --, but it is enough to satiate my curiosity.

As an added bonus, I shall be adding use Win32; to more of my scripts -- at least when profiling, because it stops the profilers profiling all the modules I'm (usually) not interested in seeing. Which both speeds up the profiling and reduces the volume of the output.

Curiosity has its upsides sometimes :) Thanks for all your help.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?


In reply to Re^17: "Automated" benchmarking by BrowserUk
in thread "Automated" benchmarking by DreamT

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (4)
    As of 2014-07-14 05:52 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      When choosing user names for websites, I prefer to use:








      Results (255 votes), past polls