Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: push, assign or split a file?

by chromatic (Archbishop)
on Jan 17, 2010 at 08:12 UTC ( #817836=note: print w/ replies, xml ) Need Help??


in reply to push, assign or split a file?

First let me show some benchmarks that demonstrate that it really is faster to use the while statement in place of a simple assignment.

Your spurious Data::Dumper calls in three of the four subs ruin the benchmark.


Comment on Re: push, assign or split a file?
Download Code
Re^2: push, assign or split a file?
by gam3 (Curate) on Jan 17, 2010 at 16:09 UTC
    The reason that I put the Data::Dumper calls in was to make sure that the ARRAY was really being put into memory and not being delayed. If all of the tests had the Data::Dumper code, it should not affect the outcome.

    I have now made it so that all the tests don't use Data::Dumper.

    -- gam3
    A picture is worth a thousand words, but takes 200K.
      If all of the tests had the Data::Dumper code, it should not affect the outcome.

      Indeed it will; if you want to measure IO for reading, don't add IO for writing. IO is too non-deterministic at this level to benchmark accurately and appropriately. (That's even without Benchmark's flaws.)

        chromatic there was no output. The Data::Dumper output was just being put in a scalar.
        -- gam3
        A picture is worth a thousand words, but takes 200K.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2015-07-06 11:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (73 votes), past polls