in reply to Re: Very Large Arrays
in thread Very Large Arrays
A 43 million element array of 20-ish character strings should come in well below 4GB.On a 64-bit system with a modern perl, it uses about 3.5Gb, assuming that the strings and the array were created in the most efficient way possible. Based on the OPs comments, I would guess they aren't being generated in the most efficient way possible; and together with the overhead of whatever the rest of code does, that swap really is an issue.
In that case, it may be worth the OP's while to try an initial sequential read of the the array to get all the elements swapped backed in, before hitting random elements. Whether this will increase performance is pure speculation at this point.
Another possibility is to use a single large string, divided into blocks of 20 chars, to avoid the overhead of the array and SVs; then access individual elements using substr().
Dave.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Very Large Arrays
by BrowserUk (Patriarch) on Feb 14, 2012 at 13:32 UTC | |
by dave_the_m (Monsignor) on Feb 14, 2012 at 20:13 UTC |