Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
> Thus, the timing produced by the module incorporate three levels of subroutine call, only one of which has been partially negated. This demonstrates the naivety of the author(s).

WOW really? Oh man, thank you for telling me!

Well, unfortunately I've never done this.

> If you write the benchmark in 1064279 like this:

Which is Kenosis code, not the code I wrote.

(playing tricks again you funny little bastard? Ha ha ha ... yawn)

The approach of hashes with

{ name1 => sub { }, name2 => sub { }, }

is well known. but it's sufficiently different to easily introduce errors.

Especially when copying existing code, things like comma-separation, indentation, positions of names, ... (see also Eily's comment).

Secondly and more importantly the need to benchmark often comes if code has already been written and experimenting starts with cloned forms of

sub do_something { # not fast enough }

then called

sub do_something_old { ... }

or

sub do_something_1 { ... }

And I don't think I'm alone, two other monks already asked about filtering some subs out of a package and/or ignoring imported subs.

Now if you don't like a convenience module to facilitate this kind of benchmarking, better don't use it.

Cheers Rolf

( addicted to the Perl Programming Language)


In reply to Re^2: RFC extending Benchmark.pm to facilitate CODEHASHREF by LanX
in thread RFC extending Benchmark.pm to facilitate CODEHASHREF by LanX

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-19 03:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found