I just started playing around with the auto-completion (text_field_with_auto_complete) stuff, and it is very nice, but it seems a little slow-- it takes about 1 second for the list to appear or for an update. The development log says the the SQL query completes in 0.01 s, so I''m wondering if there''s some built in delay in the ruby/javascript code. Is there some way to configure it to be faster? Or is the delay in WEBrick? Thanks, --Paul --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 13, 2007, at 12:40 PM, Paul Lynch wrote:> I just started playing around with the auto-completion > (text_field_with_auto_complete) stuff, and it is very nice, but it > seems a little slow-- it takes about 1 second for the list to appear > or for an update. The development log says the the SQL query > completes in 0.01 s, so I''m wondering if there''s some built in delay > in the ruby/javascript code. Is there some way to configure it to be > faster? Or is the delay in WEBrick? > > Thanks, > --PaulThere''s a (by default) 0.4s delay in the JavaScript to know that you''ve stopped typing. Then there''s the round trip to the server (which sounds like it''s local in your case), but you still might have a bit of rendering time to include which might be significant if the list of completions is long. -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks! I searched for the 0.4 and found the frequency option which (in case anyone else wants to do this) I set like this: <%= text_field_with_auto_complete :answer, :answer_text, {}, :frequency=>0.1 %> That made things faster (though not 4 times faster, because of the server response time). The downside is that now every keystroke initiates a request for an update, which might not scale so well if there are lots of users. On Mar 13, 12:59 pm, Rob Biedenharn <R...-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org> wrote:> On Mar 13, 2007, at 12:40 PM, Paul Lynch wrote: > > > I just started playing around with the auto-completion > > (text_field_with_auto_complete) stuff, and it is very nice, but it > > seems a little slow-- it takes about 1 second for the list to appear > > or for an update. The development log says the the SQL query > > completes in 0.01 s, so I''m wondering if there''s some built in delay > > in the ruby/javascript code. Is there some way to configure it to be > > faster? Or is the delay in WEBrick? > > > Thanks, > > --Paul > > There''s a (by default) 0.4s delay in the JavaScript to know that > you''ve stopped typing. Then there''s the round trip to the server > (which sounds like it''s local in your case), but you still might have > a bit of rendering time to include which might be significant if the > list of completions is long. > > -Rob > > Rob Biedenharn http://agileconsultingllc.com > R...-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Paul Lynch wrote:> Thanks! I searched for the 0.4 and found the frequency option which > (in case anyone else wants to do this) I set like this: > > <%= text_field_with_auto_complete :answer, :answer_text, > {}, :frequency=>0.1 %>/Rails Recipes/ covers auto_complete where the source array is preloaded at page fetch time. That naturally might not fit your situation. One might also think of a hybrid that preloads a table and then adds to it dynamically... -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---