[Proto-Scripty] Re: Very performant list filter

2009-02-18 Thread Walter Lee Davis
Thanks again for the advice, and let me tell you it made a huge difference when testing with 2,000 rows vs. 200. Kangax's code made for a very quick sort, but trying to do so at each keyup was a killer. Here's where I ended up in the end: var list = $$("#delegates li");

[Proto-Scripty] Re: Very performant list filter

2008-12-02 Thread Matt Foster
By using the keyup event you can avoid the conditions to check for change, if the user has pressed and released a key on the input then the value has changed. Also it is very wise to add the timeout, your users will thank you. document.observe("dom:loaded", function() { var list = $$("#listA

[Proto-Scripty] Re: Very performant list filter

2008-12-02 Thread Walter Lee Davis
On Dec 1, 2008, at 11:01 PM, kangax wrote: >> This behaves the way you would want it to -- so fast that the change >> doesn't register until the list starts getting very short. > > I think something along these lines could be faster: > > document.observe("dom:loaded", function() { > > var list

[Proto-Scripty] Re: Very performant list filter

2008-12-01 Thread kangax
On Dec 1, 1:43 pm, Walter Lee Davis <[EMAIL PROTECTED]> wrote: > I've been working on a problem today and wanted to share the results > here. I have a very tall list of authors on a page, and wanted to make > a simple filter field where you could type in a few characters of the > name and have the

[Proto-Scripty] Re: Very performant list filter

2008-12-01 Thread Walter Lee Davis
Thanks, both good ideas. Here's what I was thinking: On Dec 1, 2008, at 2:27 PM, Matt Foster wrote: > > I'd say your DOM traversals might add quite a bit of weight to your > filter. Why select the LI element if you're really looking at its > child A element's innerHTML property ? > Select those

[Proto-Scripty] Re: Very performant list filter

2008-12-01 Thread Matt Foster
I'd say your DOM traversals might add quite a bit of weight to your filter. Why select the LI element if you're really looking at its child A element's innerHTML property ? Select those nodes and skip the execution of down, should speed things up quite a bit. Also if you're using a text input co

[Proto-Scripty] Re: Very performant list filter

2008-12-01 Thread Walter Lee Davis
Wow, thanks! Had no idea. Walter On Dec 1, 2008, at 1:46 PM, Diodeus wrote: > > "Performant" isn't a word. > > http://weblogs.asp.net/jgalloway/archive/2007/05/10/performant-isn-t-a-word.aspx --~--~-~--~~~---~--~~ You received this message because you are subsc

[Proto-Scripty] Re: Very performant list filter

2008-12-01 Thread Diodeus
"Performant" isn't a word. http://weblogs.asp.net/jgalloway/archive/2007/05/10/performant-isn-t-a-word.aspx On Dec 1, 1:43 pm, Walter Lee Davis <[EMAIL PROTECTED]> wrote: > I've been working on a problem today and wanted to share the results > here. I have a very tall list of authors on a page,