in reply to Re^2: Fast Way to Split String in to Chunk of Equal Length
in thread Fast Way to Split String in to Chunk of Equal Length
Assuming your question is in regard to:
Also, if your problem allows you to unpack the strings just in time at the point where you need them, rather than en masse, avoiding the allocation, creation and destruction of 10 million concurrent small arrays -- even if you have ample memory for them -- can save a significant amounts of time.
I meant -- unpack the strings just in time at the point where you need them -- something like:
for my $seq ( @seqs ) { my @bits = unpack 'a3a3a3', $seq; ## $bits[ ... ]; }
rather than -- en masse --:
@seqs = map[ unpack '(a3)*', $_ ], @seqs; for my $ref ( @seqs ) { ## $ref->[ ... ] }
|
|---|