JQuery Or native JS?

Source: Internet
Author: User

JQuery has a caching mechanism after loading, and its underlying encapsulation in the memory does not have any performance problems. JQuery focuses on the DOM node abstraction layer. It maintains the abstraction layer and improves the Code Performance of the abstraction layer.
JQuery does not provide the performance of native js. Currently, there is no native js with the most essential features. Even if you write native js yourself, you need to write the abstract layer compatible interface. From the perspective of the design mode, the API design method helps you to achieve unified maintenance and interface management in the future, and jQuery has already done this for you.
By analyzing the jQuery source code, we can find that the sizzle parser only has complex Regular Expression parsing when using multi-level sub-selectors. The function implementation of capturing common IDs, classes, and tags has been the most streamlined, better than self-writing.
Performance is the time when I/O disk responses and floating-point operations are taken into account. It cannot be confused with the amount of code. The 9440-line code of jQuery development only occupies memory and space. After the browser reads the code into the memory, in addition to browser detection and some common $ operator detection, the jQuery code to be executed and computed is not called, and most of the Code is located in the memory heap waiting for subsequent interface calls, in terms of loading overhead, there is only one additional request with a 90kb additional traffic. If jQuery's existence and practical value or low performance are negated based on this, then there will be no further discussions.
With a 7-year framework, their efforts are constantly trying to improve the performance. They do not give up and bring fun and even rich income to front-end beginners and even agile developers. So far, she still has a firm presence. The key to its advantages and disadvantages lies in its use and understanding of people.
You don't want to develop your own framework, but you need to work hard and never give up. You need to stick to it and maintain your framework. If you have dug a hole, you must try to fill it in, do not let others step on your trap and fall down or fall down on your own.
The development framework of a large company is only part of B and cannot deny that it does not exist. However, the key point is that a large company has the strength to develop this huge framework or function library system. They are not afraid of digging holes, and some people fill in them. More importantly, I think front-end engineers of large companies believe that this is their dream. They are realizing their dream-developing a self-owned and team-based framework, because the company has given them such good conditions, treatment, and environment, they have the energy, time, and even fun to develop these frameworks. Individual developers or small teams in small companies-your boss, your companions, your work environment, your work returns, and a steady stream of customer needs and orders can make you unable to calm down at all. develop a real framework.
The existence is reasonable. jQuery, native js, and its own framework .... And so on, we are focusing on front-end, js, code maintenance, and performance. What we need now is to improve our js technology and our own understanding of the big front end, when you use the most appropriate solution at the right time, you will say, "What do you say? Technology is not a problem !" Be a casual, romantic, and casual front-end engineer!
 

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.