Standalone JavaScript Selector Engines
One of the most used and helpful feature of any Javascript framework is probably their selector function. It allows us to search and filter elements using CSS like selector syntax. This means it takes out the tedious part in DOM scripting and enables developers to write less and more reliable code. As a result, we all expect to see some sort of selector engine in all javascript framework.
However, there are still rooms for improvement and reasons to have standalone selector engines that are not part of any framework. Since selecting elements are the most common operational you would do, any improvement would increase the overall performance of your script.
Looking at recent development, there are definitely people believing the need for standalone selector. Here are 4 robust and small standalone Selector engines you can check out.
Sly
This is the new comer of selector engine which launched last week and does look very strong. It support CSS3 selector standard, small and fast. Their test shows that it is faster than most of the framework based selector out there.
Source
Sizzle
Sizzle is created by the creator of jQuery – John Resig. Again this is a very small, robust library. The idea is to have a javascript selector engine that could be dropped into other framework / library. So instead of reinventing the wheel by frameworks writing their own selector engine, Sizzle is here to solve the problem once and for all. John is trying to get other framework to use Sizzle and of course the latest jQuery 1.3 is already using Sizzle as their selector engine. The code has definitely matured since release last year and is definitely interesting to see if others start integrating it.
Source
Again all the standard CSS3 selector support, small file size plus from their test page, it does seems to be faster than Sizzle. (but I think it was testing against early version of Sizzle)
from llamalab
Another new selector engine released this year that implements CSS3 selector standard and is looking pretty strong in performance too.
Post a comment