Autocompeter 1.1.8 and smooth typing

06 April 2015   0 comments   Go, Javascript

Powered by Fusion×

One of the most constructive pieces of feedback I got when Autocompeter was on Hacker News was that when you type something with lots of predictable results the results overlay would "flicker".

E.g. you type "javascript" in a nice and steady pace and the overlay would shrink and grow and shrink and grow very rapidly.

The reason it happened was due to a bug in the javascript code that filtered results whilst waiting for the next AJAX request from the latest typed character. E.g. you type "ash" and the results comes back with "ashley", "ashes", "Ashford". Then you add a "l" so now we start a new AJAX query for "ashl" and whilst waiting for that output from the server we can start filtering out "ashes" and "Ashford" because we can pre-emptively know that that won't be in the new result set.

The bug was a bad function that filtered the existing results on a second rendering whilst waiting for the next AJAX. It was easy to fix and this is included in version 1.1.8.

The reason I failed to notice this was because I had inserted some necessary optimizations when the network latency was very very slow but hadn't tested it in a realistic network latency environment. E.g. a decent DSL connection but nevertheless something more advanced that just connecting to localhost.

Comments

Thank you for posting a comment

Your email will never ever be published


Related posts

Previous:
Autocompeter.com 02 April 2015
Next:
gulp-header is the best! 09 April 2015
Related:
Autocompeter is Dead. Long live Autocompeter! 09 January 2017
A quicksearch for Bugzilla using Autocompeter 27 January 2016
How I installed letsencrypt for Nginx 26 January 2016
Match the whole word in auto complete maybe 10 April 2015
gulp-header is the best! 09 April 2015
Autocompeter.com 02 April 2015
Median size of Javascript libs on jsDelivr 24 February 2015