[ 3 posts ]

mc_hendriks

  • Joined: Sat Apr 24, 2010 5:53 am
  • Posts: 43
  • Offline
  • Profile
Tags:

Why is the autocomplete function so slow.

Post Posted: Tue Sep 14, 2010 2:21 am
+0-
When I click on the example of the autocomplete it takes over 5 seconds (after a initial load for caching)before the fields are available. Total of JS code > 1MB.
Is there anyway to improve this drastically?

Nate Cavanaugh

YUI Contributor

  • Offline
  • Profile

Re: Why is the autocomplete function so slow.

Post Posted: Tue Sep 14, 2010 7:58 am
+0-
Hi there,
The reason is because on the examples that go through http://alloy.liferay.com/deploy/demos, we are using the "raw" filter, which means we're not only sending over the uncompressed js, but also not combining it either. And since it's not being combined into a single request, this means that it will download each request as it can (basically, 2 at a time), so things transfer much more slowly.

To see an optimized example of this, check out: http://alloy.liferay.com/demos.php?demo=autocomplete
We wrote a PHP combo file (which is also available in the Alloy zip available on http://alloy.liferay.com) which you can use as your combo service.
But you'll notice it not only loads *much* faster, but the total transfered js for that demo is 31k (that's the amount transfered through the combo, all of the other JS transfered is shared across all of the pages).

Basically, the *polished* demos are to showcase the functionality, whereas the developer demos (which we're planning to rename to "sandbox") are more for learning, debugging and develop with.

I hope that answers your question, but please let me know :)

mc_hendriks

  • Joined: Sat Apr 24, 2010 5:53 am
  • Posts: 43
  • Offline
  • Profile

Re: Why is the autocomplete function so slow.

Post Posted: Sat Sep 18, 2010 3:37 am
+0-
Yes thats much better. I've downloaded the complete set and it's working fine now.
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum