On Tue, Oct 03, 2000 at 04:30:52PM -0400, Ben Tilly wrote:
> I have not tracked the code down yet, but the problem is that
> when an array needs to be moved, it is always kept aligned on
> a boundary so that that the next unshift will need to move it
> again.  If you unshift 50,000 times this gets slow.

It's a fundamental algorithms thingy. If access is going to be O(1),
then insertion has to be O(n), and vice versa. (The proof is left as a
trivial exercise for the reader.) Unless arrays become hashes. Let's not
go that way.

-- 
"The Amiga is the only personal computer where you can run a multitasking 
operating system and get realtime performance, out of the box."
-- Peter da Silva

Reply via email to