Time-sharing Optimization of Javascript large arrays

Source: Internet
Author: User

Inspired by Nicholas C. Zakas's Timed array processing in JavaScript.

An example of loading large table data: array-processing.html

Notes:

  1. The timedChunk function is the essence, in which 50 ms is from the results of the Response Time Overview Survey: The Response within 100 ms can make the user feel very smooth. 50 ms is the best JavaScript experience of Nicholas.
  2. The latency of setTimeout is 25 ms because of the time resolution problem of the browser. 25 ms ensures that mainstream browsers are smooth (there is a chance to update the UI ).
  3. In the above example, loading in the traditional way will make the browser unable to update the interface and respond to any operation during data loading. With time-sharing loading, the browser can always be responsive, improving the smoothness of the interface and user experience.
  4. Gossip by the way: Safari 4 and Chrome 2 are really not blowing, and the speed is too high. Firefox and IE are slow enough.
  5. Opera still maintains the characteristics of geeks, and the traditional loading method can also maintain interface updates and responses, but it is a pity that the speed is not good and mixed.
  6. In the end, I admire the short piece of code in Nicholas C. Zakas, which contains knowledgeable usable knowledge, professional JS skills, and careful crazy testing. Such a cool person is an excellent example for learning.

Source: http://lifesinger.org

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.