in reply to Re^2: Why should I use perl 5.10?
in thread Why should I use perl 5.10?

Faster? Anyone got some numbers to prove this?

Replies are listed 'Best First'.
Re^4: Why should I use perl 5.10?
by syphilis (Archbishop) on Dec 21, 2007 at 11:52 UTC
    Faster? Anyone got some numbers to prove this?
    use Benchmark; timethese(100000, { 'Test' => 'eval{die "x" x 100000 if $] < 5.01}', });
    Under perl 5.8:
    Benchmark: timing 100000 iterations of Test... Test: 15 wallclock secs (14.98 usr + 0.00 sys = 14.98 CPU) @ 66 +73.34/s (n=100000))
    Under perl 5.10:
    Benchmark: timing 100000 iterations of Test... Test: 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU) @ 62 +50000.00/ (n=100000) (warning: too few iterations for a reliable count)
    Whooooo ... how good is *that* !!!!!

    Cheers,
    Rob
      In a less trivial example...

      I was benchmarking a module I wrote against one I found on CPAN solving the same problem. I decided to see how using 5.10 compared to using 5.8 at the same time.

      My module (which was already faster) saw a 10% improvement with 5.10. The CPAN module saw a negligible improvement (about 1%) using 5.10.

      using 5.10 didn't hurt and in some circumstances added a nice boost. Depends on how you are using perl.

      Maybe later I'll dig a little deeper and see what the CPAN module did differently to get so little benefit out of 5.10.