[jQuery] Re: Performance Problems with Suggestion Plugin

2009-12-09 Thread T.J.
I just ran a page with an absurd amount of inputs through the Firebug profiler and it seems that the majority of the time spent running scripts is inside jQuery's (I'm using 1.4a1) Sizzle selector, which makes me think I'm inefficiently using selectors (which I can almost guarantee is the case).

[jQuery] Re: Performance Problems with Suggestion Plugin

2009-12-09 Thread T.J. Simmons
And I think I've fixed this.. I'm not sure how to describe what it is that I fixed, but performance is vastly improved, although it still slows down a little bit with an absurd amount of possible inputs. If anyone wants to take a look at my code and optimize it further, please let me know.

[jQuery] Re: Performance Problems with Suggestion Plugin

2009-12-09 Thread Cameron van den Bergh
Hi, To improve efficiency, try using contexts in order to restrict the parsed DOM elements. For example, if you know that all targeted elements are in div id=main . stuff p class=myclass .. target text.../ p . /div then you should guide the selector engine towards the target :

[jQuery] Re: Performance Problems with Suggestion Plugin

2009-12-09 Thread T.J. Simmons
I don't ever use absolute selectors like that. The most general I get is using a class as the selector. I've made a few tweaks (such as moving a large block of code from inside the return this.each section of the plugin to before it) on both the plugin and the page I'm using it on, which seems to