in reply to Re^3: Handling HUGE amounts of data
in thread Handling HUGE amounts of data
Well, it still throws an 'out of memory' when I close the little Perl/Tk that announces the script has finished running.
I assume I've done this right as BrowserUk suggested using Tie::Array::Packed to save on RAM:
tie @aob, 'Tie::Array::Packed::DoubleNative'; #model 1; sub popnum1 { ( $x, $y, $z ) = @_; if ( $y == 0 ) { $aob[$x][0] = $initial + $z; $zaza = $aob[$x][0]; } else { if ( substr( $aod[ $y - 1 ], $x, 1 ) ne 'a' ) { $aob[$x][$y] = $initial + $z; $zaza = $aob[$x][$y]; } else { $aob[$x][$y] = $z + $aob[$x][ $y - 1 ]; $zaza = $aob[$x][$y]; } } return $zaza; }
I figure that returning a single variable ($zaza)is more efficient than returning $aob[$x][$y] - it's hard to tell.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Handling HUGE amounts of data
by BrowserUk (Patriarch) on Jan 31, 2011 at 20:07 UTC | |
by Dandello (Monk) on Jan 31, 2011 at 20:49 UTC | |
by BrowserUk (Patriarch) on Jan 31, 2011 at 20:52 UTC | |
by Dandello (Monk) on Jan 31, 2011 at 23:48 UTC | |
by BrowserUk (Patriarch) on Feb 01, 2011 at 00:05 UTC |