Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Benchmark tips

by TheDamian (Priest)
on Apr 14, 2003 at 22:43 UTC ( #250434=note: print w/ replies, xml ) Need Help??

in reply to Benchmark tips
in thread Making a match

WRT suggestion 1: just thought I should mention that I was, of course, far too Lazy to actually align them myself:

use List::Util 'max'; sub align { my ($hash) = @_; my $len = max map length, keys %$hash; $hash->{sprintf "%${len}s", $_} = delete $hash->{$_} for keys %$hash; return $hash; } cmpthese(10000, align { 'Bacon, Lettuce, & Tomato' => sub {...}, 'Ham on Rye' => sub {...}, 'Spam' => sub {...}, # etc. });

Comment on Re: Benchmark tips
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://250434]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2015-11-30 12:21 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (769 votes), past polls