z-index1000000 / q Goto Github PK
View Code? Open in Web Editor NEWThis project forked from hackwaly/q
blazing fast jit compile javascript css selector!
This project forked from hackwaly/q
blazing fast jit compile javascript css selector!
1, 和Sizzle的兼容 Q(expr, context, result, seed) Q.matches 支持Sizzle特别的setFilter伪类如:even,:first,:last,:lt... 支持复杂的:not和:has选择器(和sizzle一样) 2, 结果的正确性 Sizzle在某些选择器上由于查询策略的原因,会返回错误的结果 考虑在这样的html上查询 "<div/><h1/><h1/><div/>" 查询 div~div : 应返回1个节点 查询 h1~div: 应返回1个节点 查询 div+h1~div: 应返回一个节点,但是Sizzle没有找到节点 另外 div.querySelectorAll("body *")会返回节点 所以在以元素为context的查询中不使用querySelectorAll进行优化 3, 性能 将选择器编译成函数再进行查询,除了第一次查询需要jit编译之外,以后每次查询都是最快的速度 查询策略引擎会分析选择器的组成,选择最恰当的查询策略(从开始查还是从末尾查还是从中间开始) 排除不必要的运算,如sizzle中的:lt伪类,这里查询时找够节点就会跳出查询,不会继续做无谓的查询 可以参考slickspeed. http://jselector.googlecode.com/svn/trunk/jsslickspeed/index.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.