📜 ⬆️ ⬇️

Version 0.2.4: more, better, faster

Many new and good things:



Thanks to everyone who responded and somehow contributed to the development of the project. Be sure to find the time and lay out links to all the characters.

Now the main thing: it was possible to significantly improve performance and add support for selectors [name=value] (in the singular) and :first-child, :last-child, etc (in the singular). The code was very much refactored. In particular, all the simplest calls were transferred to associative arrays (for tag, class and identifier).
')
Now you can operate like this:
  a.link [class = menu]
 div p: first-child
 body table form: only-child
 form input [type = checkbox]: checked 


The main function was divided into three - it significantly accelerated the overall speed. Apparently, when calling a method, its local version is created, the time for its creation is proportional to the complexity of the function (in fact, the number of elementary operations). Therefore, it turned out that small functions that call each other work faster than a single large one.

While support for full CSS3 is not planned (IMHO, now you can almost choose any element). But I consider this possibility.

The list of all improvements is large enough, you can see it in SVN: code.google.com/p/yeasss . From myself, I can add that, in addition to the above-described tweaks, the arguments[] calls were also replaced with the usual named parameters of the function. Also, caching (as a fairly “weighty” operation with a large amount of tree) was moved directly to the return value: now the assignment occurs in the return itself.

Download the latest versions:
Full: yass.webo.in/yass.0.2.4.js
Minimized: yass.webo.in/yass.0.2.4.min.js

At the moment, the public in one form or another requires refinement of visual effects and functionality. But I personally have big doubts as to which way to go in this direction: expansion of the created object (wrapper) or adding properties at the global window._ . If anyone has any ideas - please share.

PS In order to somehow fix the acceleration, we had to slow down the SlickSpeed ​​tests on the site: for regular libraries they work extremely slowly, it is not recommended to select them when comparing speed.

SlickSpeed ​​PPS tests themselves introduce a sufficient error in the calculations (as in quantum physics: to measure the state, it is impossible not to change it), so I consider them only as indicative. In particular, in Opera they give a big scatter.

Source: https://habr.com/ru/post/46766/


All Articles