> Here's an idea for the future:
>
> Multiple/alternative selector schemes (ie. CSS3, XPath1, XPath2)
> and compilation of selectors into native Javascript.
The thread about benchmarks got me thinking about compilation and caching of
selectors too. It could be a big win for benchmarks where they use the same
selector in a loop 1000 times! :-) Most real-life code uses maybe a dozen or
two unique selectors per web page but uses them repeatedly, and that would
also seem to benefit with compilation. Looking at the actual jQuery core
code, I wasn't sure that compilation would provide a lot of performance
benefit because parsing of the selector string seems easy compared to the
amount of work required to find the elements--for example, $(".myclass") in
an entire document. Ideally it could reduce cases like "#myid" to
nearly-getElementById speeds though. Having plugins for alternative selector
schemes also sounds interesting.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/