Forum: Rails Spinoffs (closed, excessive spam) DOM traversal functions performance

4ab185c23be3076c02c2b7b7f48062d1?d=identicon&s=25 henry.christopher@gmail.com (Guest)
on 2008-06-18 06:59
(Received via mailing list)
Hello List,

Has anyone had difficulties with the performance of Prototype's DOM
traversal functions (Element#up, Element#down, etc.)?

I'm building out a rather complex application with Ext and Prototype
1.6.0.  When setting everything up, I will occasionally have to
instantiate a few hundred objects, and each one uses Element#up.  When
there were a lot of objects, this operation could take as long as 10
seconds in iE7.  I've since refactored, but are there any performance
improvements in the works for these functions?

Chris Henry
F1fcf834ddad415f60d29c87cc10d4d4?d=identicon&s=25 kangax (Guest)
on 2008-06-18 14:32
(Received via mailing list)
#up should be fast when called without arguments, as it simply returns
an extended parentNode.
When given "index", it actually collects all ancestors first, so that
should indeed be slow in a complex document.
There's also an unnecessary element extension (which slows down IE
even more).

Thanks, we'll look into it.

- kangax


On Jun 18, 12:58 am, "henry.christop...@gmail.com"
This topic is locked and can not be replied to.