如何提高Jquery自动完成的性能 [英] How to improve performance of Jquery autocomplete

查看:8
本文介绍了如何提高Jquery自动完成的性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我计划在一个站点上使用 jquery 自动完成功能,并且已经实现了一个测试版本.我现在使用 ajax 调用来为每个字符输入检索一个新的字符串列表.问题是它变得相当慢,在填充新列表之前 1.5 秒.快速自动完成的最佳方法是什么?我正在使用 cakephp 并且只是做一个查找并且限制为 10 个项目.

I was planning to use jquery autocomplete for a site and have implemented a test version. Im now using an ajax call to retrieve a new list of strings for every character input. The problem is that it gets rather slow, 1.5s before the new list is populated. What is the best way to make autocomplete fast? Im using cakephp and just doing a find and with a limit of 10 items.

推荐答案

这篇文章 - 关于 flickr 如何自动完成是一本非常好的读物.我有一些哇"的阅读体验.

This article - about how flickr does autocomplete is a very good read. I had a few "wow" experiences reading it.

"此小部件下载所有您的联系人,在 JavaScript 中,在低于 200 毫秒(即使对于拥有 10,000 多个联系人的成员).在为了达到这个水平性能,我们必须完全重新思考我们如何从服务器到客户端."

"This widget downloads a list of all of your contacts, in JavaScript, in under 200ms (this is true even for members with 10,000+ contacts). In order to get this level of performance, we had to completely rethink how we send data from the server to the client."

这篇关于如何提高Jquery自动完成的性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆