Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Wasting time thinking about wasted time

by brian_d_foy (Abbot)
on Sep 23, 2004 at 04:50 UTC ( #393128=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Benchmark qw{ timethese };
    
    ...
            glob "/bin/*";
            },
        });
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    ...
    print "Timing for $iterations iterations\n";
    
    timethese( $iterations, $code );
    
  3. or download this
    albook_brian[519]$ perl benchmark
    Testing with 380 files
    ...
    schwartz_orig_assign: 14 secs ( 7.76 usr +  5.41 sys = 13.17 CPU) 
    sort_names:            0 secs ( 0.00 usr +  0.00 sys =  0.00 CPU)
    sort_names_assign:     0 secs ( 0.39 usr +  0.00 sys =  0.39 CPU) 
    
  4. or download this
    Benchmark: timing 1000 iterations of glob, ordinary_mod, schwartz_mod,
    + schwartz_orig_assign...
          glob:           14 secs ( 6.28 usr +  8.00 sys = 14.28 CPU) 
    ...
    schwartz_mod:         20 secs (14.06 usr +  5.52 sys = 19.58 CPU) 
    schwartz_orig:        32 secs (17.38 usr + 13.59 sys = 30.97 CPU) 
    schwartz_orig_assign: 34 secs (19.95 usr + 13.60 sys = 33.55 CPU) 
    
  5. or download this
    Benchmark: timing 1000 iterations of glob, ordinary_mod, schwartz_mod,
    + schwartz_orig_assign...
          glob:           148 secs ( 31.26 usr + 102.59 sys = 133.85 CPU) 
    ...
    schwartz_mod:         151 secs ( 68.88 usr +  67.32 sys = 136.20 CPU) 
    schwartz_orig:        297 secs ( 89.33 usr + 174.51 sys = 263.84 CPU) 
    schwartz_orig_assign: 294 secs ( 96.68 usr + 168.76 sys = 265.44 CPU) 
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://393128]
Approved by FoxtrotUniform
Front-paged by Courage
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-10-23 05:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (124 votes), past polls