in reply to Re^8: Performance oddity when splitting a huge file into an AoA
in thread Performance oddity when splitting a huge file into an AoA
The zip worked fine.
I cannot make much sense of the statistics either. There is something weird going on. The spliting seems to be taking an inordinate amount of time.
Part of the problem is that with all three files calling the same subroutine, all the statistics get lumped in together and averaged out, so you cannot see if there is any significant differences between the first run and the other two.
To address that, I'd create C&P copies of the X() subroutine (say x1() x2() & x3()), and call a different version for each file. That will break out the timings for each file and perhaps highlight run to run differences.
Also, from the numbers presented, it looks like end-of-loop overhead is getting lumped in with the last statement in the loop. To counter that, I'd stick a dummy statement at the bottom of the loop:
my $dummy; sub x1{ open my $fh, '<', shift or die $!; my @AoA; while (my $line = <$fh>) { my @line_arr = split ',', $line; #push @AoA, \@line_arr; $dummy = 1; } }
Next time i'll just upload the nytprof.out file.
That would certainly be easier (I assume by "upload", you mean here to PM!). Especially for anyone attempting to follow along.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Performance oddity when splitting a huge file into an AoA
by Xenofur (Monk) on May 09, 2009 at 10:07 UTC | |
by BrowserUk (Patriarch) on May 09, 2009 at 18:45 UTC | |
by Xenofur (Monk) on May 09, 2009 at 19:26 UTC | |
by roubi (Hermit) on May 09, 2009 at 13:20 UTC | |
by Xenofur (Monk) on May 09, 2009 at 16:30 UTC |