博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
万维网
阅读量:5041 次
发布时间:2019-06-12

本文共 3333 字,大约阅读时间需要 11 分钟。

Client side performance

Performance issues

In the last years client side performance has become an issue. Many sites use Ajax and complex JavaScript for creating RIA applications resembling desktop apps. In many cases there are severe performance problems. 

Browsers keep improving JavaScript's speed. Most of them use hotspot compilation for repeating code. Other optimizations are used, for instance Chrome's JavaScript engine uses hidden classes to decrease the penalty caused by JavaScript's dynamic qualities. 
Other operations are also optimized and get faster each version. For example, Firefox speculative parser enables concurrent download of resources without interfering with the document processing. 

Even with enhanced speed, performance is still an issue. Steve Souders, a "performance guru" from Google, checked and found out that in average, client side processing takes more time than the server side.

Correct code makes good performance

It is important to understand that the way we write our code has a dramatic influence on performance. 

There are many resources for performance tips. Here are some good ones: 

 

Performance tools

There are some good tools for performance analysis and profiling. Unfortunately, they are currently specific to each browser. 

There is a new  specification that is beginning to be implemented by Webkit and Firefox. This may allow for a unified performance tool for all browsers.

Static analysis tool:

  •  is a Firefox extension that checks the application and grades it according to its conformance with performance best practices. It does static analysis of the HTML code. The results are mostly applicable to all browsers, not just Firefox.
    Since it’s targeted towards Firefox, some fine grained performance problems in other browsers will be missed - for example Chrome and Safari react badly to inline style tags and perform style recalculation of the entire DOM tree, this is missed by YSlow.

Run time profilers - these tools measure the browser's internal operations like resource loading, parsing, layout and painting:

    • For Chrome - . A Chrome extension that gives performance information in a graphical way. It also gives you "hints" - marks the location of a potential problem and gives a clear textual explanation. 
      Very useful for finding performance bottlenecks. A great tool but only for Chrome (although the results will probably be relevant for other browsers).
    • For Safari and Chrome - Timeline tab. It is located in the developer tools that come with the browsers. It brings a subset of Speed Tracer data (both browsers are based on the same engine). The graphical view is less clear and it lacks Speed Tracer's performance hints. The developer tools include also a JavaScript profiler (CPU and heap). You can find a good quick start tutorial for developer tools .
    • For Intenet Explorer - . An IE extension. It’s gives extensive profiling data. A nice feature - it can display the JavaScript code being executed, making it easy to pinpoint to the bottleneck code.
    • For Firefox - the well known  extension. It contains only network information and JavaScript profiler - no internal browser operations data. Mozilla are going to add integrated developer tools support in their next Firefox release. Perhaps it will contain such data.

转载于:https://www.cnblogs.com/SofuBlue/p/8029099.html

你可能感兴趣的文章
C语言键盘按键列表
查看>>
Codeforces Round #374 (Div. 2)
查看>>
oracle数据类型
查看>>
socket
查看>>
Vue中使用key的作用
查看>>
二叉索引树 树状数组
查看>>
日志框架--(一)基础篇
查看>>
Java设计模式之原型模式
查看>>
Spring学习(四)-----Spring Bean引用同xml和不同xml bean的例子
查看>>
哲理故事与管理之道(20)-用危机激励下属
查看>>
关于源程序到可运行程序的过程
查看>>
wepy的使用
查看>>
N3292系列资料之RTC介绍
查看>>
System.ValueTuple 未定義或匯入預先定義的類型
查看>>
Redhat6.4安装Oracle 11gr2 64位 注意事项
查看>>
rpm
查看>>
Finance_books_LTCM
查看>>
Http协议
查看>>
2016福州大学软件工程第二次团队作业——预则立&&他山之石成绩统计
查看>>
HDU - 5338 ZZX and Permutations 线段树 + set
查看>>