Chet Ramey wrote:
I'm sure there are efficiency improvements possible in the bash indexed
array implementation, but sequentially accessing a data structure
optimized for space and sparse arrays is never going to be as fast as
a read-process loop, and that difference becomes more and more apparent
the larger the array.

Maybe bash should remember the last position to optimize accessing the next element?

There are also always hash tables, which are a bit more expensive in memory use, but would provide faster lookups (and I /really/ hope you're using a hash - or at least some kind of tree - and not a list for named-element arrays!).

--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
Anyone who is capable of getting themselves made President should on no account be allowed to do the job. -- The Hitchhiker's Guide to the Galaxy (Douglas Adams)



Reply via email to