Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

No Benchmark is better than a bad Benchmark

by Abigail-II (Bishop)
on Aug 19, 2002 at 11:49 UTC ( #191143=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        $ perl -MO=Deparse -wce 'sprintf "%x%x%x", ord ("a"), ord ("b"), o
    +rd ("c")'
        Useless use of a constant in void context at -e line 1.
    ...
        '???';
        -e syntax OK  
        $
    
  2. or download this
    #!/usr/bin/perl
        
    ...
    Benchmark: running sprintf, unpack for at least 10 CPU seconds...
       sprintf: 11 wallclock secs (10.25 usr +  0.00 sys = 10.25 CPU) @ 77
    +5053.56/s (n=7944299)
        unpack: 11 wallclock secs (10.48 usr +  0.01 sys = 10.49 CPU) @ 33
    +1145.09/s (n=3473712)
    
  3. or download this
        $ perl -MO=Deparse -wce '$_ = sprintf "%x%x%x", ord "a", ord "b", 
    +ord "c"'
        BEGIN { $^W = 1; }
        $_ = '616263';
        -e syntax OK
        $  
    
  4. or download this
        $ perl -MO=Deparse -wce '($a, $b, $c) = split // => "abc";
                   $_ = sprintf "%x%x%x", ord $a, ord $b, ord $c'
    ...
        $_ = sprintf('%x%x%x', ord $a, ord $b, ord $c);
        -e syntax OK
        $
    
  5. or download this
    #!/usr/bin/perl
     
    ...
    Benchmark: running sprintf, unpack for at least 10 CPU seconds...
       sprintf: 11 wallclock secs (10.51 usr +  0.01 sys = 10.52 CPU) @ 20
    +8379.75/s (n=2192155)
        unpack: 10 wallclock secs (10.10 usr +  0.00 sys = 10.10 CPU) @ 32
    +3836.04/s (n=3270744)
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2014-10-02 17:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (66 votes), past polls