cormanaz has asked for the wisdom of the Perl Monks concerning the following question:

When you get an output from SmallProf like

        4 6.687500 6.671000   216:    $self->Fetch($key, !$Win32::OLE::Strict);

does that mean your code spent 6.68 wall seconds for each of 4 times through line 216 (26.72 sec total), or that in all 4 visits it spent a total of 6.68 seconds?

Thx...Steve

Replies are listed 'Best First'.
Re: SmallProf output question
by GrandFather (Saint) on May 02, 2007 at 01:20 UTC

    Total time so time per iteration is <time> / <num> = 6.687500 / 4. For example the following result was obtained in under a second:

    ================ SmallProf version 2.01 ================ Profile of noname1.pl + Page 1 =============================================================== +== count wall tm cpu time line 0 0.000000 0.000000 1:use strict; 0 0.000000 0.000000 2:use warnings; 0 0.000000 0.000000 3: 1 0.000001 0.000000 4:my @strs = (".", ","); 0 0.000000 0.000000 5: 1 0.000000 0.000000 6:for (1 .. 1000) { 1000 0.547915 0.000000 7: print "@strs\n"; 0 0.000000 0.000000 8:}

    DWIM is Perl's answer to Gödel