Comparison of Javascript efficiency in various Javascript browsers _ javascript skills

Source: Internet
Author: User
Comparison of the Javascript efficiency of various Javascript browsers it is reported from an article on "translated words" that the comparison of Javascript in various browsers. As a Javascript developer, I personally pay more attention to this matter. I still trust SunSpider in the test area, as the original article says, "It is a group of well-designed tests that are easy to run and comprehensive ".

The test content is as follows:

3d-purely JavaScript 3D rendering operations, but do not include the rendering part. It contains a large number of floating-point operations and Array Operations.
Access-array, access to object attributes and variables.
Bitops-bit operations, which are important for games, mathematical operations, and multiple types of encoding and decoding. It is also the only Integer Operation in JavaScript.
Controlflow-control flow structure (repetition, recursion, condition ). At present, it is mainly a recursive structure, but other structures are also included.
Crypto-the real encryption code, mainly bit operations and string operations.
Date-"date" Object performance.
Math-multiple mathematical operation types.
Regexp-regular expression.
String-string processing, including generating a giant "tagcloud" code, decompressing the compressed Javascript code, and so on.

In addition to the comparison above, the Statistical Chart below compares the performance of various browsers more intuitively.


Although the string generated by the test is almost impossible in most production cases, I am still quite vocal about the low running efficiency of IE. To exclude the weakest string operation of IE, I was surprised by the test of excluding strings. Firefox is not much faster than IE. As I was looking forward to the previous test of Firefox 3 beta, I hope it can run faster.

Safari is also a browser that I have been paying attention to. It is still very satisfied with the efficiency in this test. As for Opera, it can be seen that the author of the original article has also given it a very high rating. the title "The fastest browser in the world" seems to be exactly what it belongs.

To sum up, most browsers in China are dominated by IE, so according to the above tests, especially for Javascript, character string operations should especially consider its performance. I found that the running efficiency of Javascript Regular Expressions in IE is quite satisfactory. I will give priority to using regular expressions if I encounter the comparison of string operations in the future.

Finally, we recommend that you continue to read the original article link.

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.