in reply to No More Meaningless Benchmarks!

To point out that this benchmark is even more useless: I would think that the major differences between double and single quotes are going to be at compile time and not run time, and this benchmark only times the runtime differences.
-- gam3
A picture is worth a thousand words, but takes 200K.

Replies are listed 'Best First'.
Re^2: No More Meaningless Benchmarks!
by liverpole (Monsignor) on Dec 09, 2006 at 23:32 UTC
    Excellent point!  ++gam3.

    To prove it to myself ...

    #!/usr/bin/perl -w use strict; use warnings; my $d = "This is a double-quote string\n"; my $s = 'This is a single-quote (apostrophe) string' . "\n"; print $d; print $s; # Results ... BEGIN { $^W = 1; } use warnings; use strict 'refs'; my $d = "This is a double-quote string\n"; my $s = "This is a single-quote (apostrophe) string\n"; print $d; print $s; quotes.pl syntax OK

    Looks pretty convincing to me!


    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
Re^2: No More Meaningless Benchmarks!
by sgt (Deacon) on Dec 10, 2006 at 18:21 UTC

    Very true. I was going to mention that myself.

    Still i believe a benchmark always says something. It's like profiling; it is often important to think about using it. Even if the benchmark tells nothing in a case like this one, still, the effort of thinking about why it does not tell anything is a useful exercise.

    hth --stephan
Re^2: No More Meaningless Benchmarks!
by belg4mit (Prior) on Aug 27, 2008 at 16:58 UTC