in reply to Re^4: Performance oddity when splitting a huge file into an AoA
in thread Performance oddity when splitting a huge file into an AoA
Suggestions as to what tests i can run are welcome.
The profiling you've done doesn't get into enough detail in the critical areas.
The first thing I would try, is isolating whether the extra time is spent reading from the file or shuffling memory. To that end, I'd see what happens to the timings if I just read the data but didn't store it:
#! perl -slw #use 5.010; use strict; use Time::HiRes qw[ time ];; sub x{ open my $fh, '<', shift or die $!; # my @AoA; my $dummy = [ split ',' ] while <$fh>; close $fh; return $.; } for ( 1 .. 5 ) { my $start = time; printf "Records: %d in %.3f seconds\n", x( sprintf 'junk%d.dat', 1+ ($_ & 1) ), time() - $start; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Performance oddity when splitting a huge file into an AoA
by Xenofur (Monk) on May 07, 2009 at 09:40 UTC | |
by BrowserUk (Patriarch) on May 07, 2009 at 10:26 UTC | |
by Xenofur (Monk) on May 07, 2009 at 15:20 UTC | |
by BrowserUk (Patriarch) on May 07, 2009 at 18:33 UTC | |
by Xenofur (Monk) on May 09, 2009 at 10:07 UTC | |
| |
by parv (Parson) on May 07, 2009 at 10:21 UTC | |
by Xenofur (Monk) on May 07, 2009 at 15:22 UTC | |
by parv (Parson) on May 07, 2009 at 17:09 UTC |