in reply to Slow Dereferencing and Not Sure Why
You didn't show us the relevant part of your code, as the output you show is not generated by your code.
One thing though:
my @lines = @{$ArrayRefs[$i]};
This line will create a (shallow) copy of the whole array, which will consume memory and which will take time. If that's not what you want, because you're not actually modifying the stuff in @lines, then you can replace @lines by $lines (for example) and modify your remaining code to use @$lines appropriately, and you should gain at least a reduction in memory used.
You might also want to take a look at the memory consumption of your code. I think every array element uses up at least about 32 bytes plus the length of the string it contains, so your machine might or might not simply run out of memory.
Most of the efficiency gains will be made through the choice of an appropriate algorithm, so if you show us what your program is actually doing and how it processes the input, maybe we can find a way to make the program do less work overall instead of optimizing how quickly it does its work for a single line.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Slow Dereferencing and Not Sure Why
by deequeue (Initiate) on Jun 19, 2009 at 00:53 UTC |