by
allistar >> Mon, 28 Apr 2003 22:11:42 GMT
Hi Allistar,
Haven't tried this but I think it could be due to the way that array elements are accessed in Jade. If your code is something like
[snip]
In spite of the extra copying (the two while loops and the copy just before the epilog) I would suspect that this will still be much faster than the first code fragment for large arrays.
I'd be interested to hear it goes.
Brendan
Hi Brendan,
Thanks for that. I ended up creating a new array and using an interator to add items from the old arrays into the new one accordingly. That was the solution I didn't want to use as even though it is faster than indexing into the other two arrays, it still requires me to touch every single object in the two arrays to make the new combined array (which is bad if there are a million objects). I was hoping that there was some trick in Jade to take advantage of how the collection blocks work to combine two large arrays efficiently.
Thanks for the tips though, it works fast enough for the time being.
Regards,
Allistar.
------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst
allistar@silvermoon.co.nz
Auckland, NEW ZEALAND
Silvermoon Software
Specialising in JADE development and consulting
Visit us at:
http://www.silvermoon.co.nz ------------------------------------------------------------------