New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify filtering by selector in winnow
#3272
Comments
Poor man's jsPerf benchmark: https://jsfiddle.net/uo2j7syk/ # {method}_{selector complexity}_{implementation}
find_simple_master: 1,125 ±2% (1,105–1,145) ops/sec
find_simple_direct: 1,140 ±2% (1,122–1,157) ops/sec
find_simple_intersect: 190 ±2% (186–193) ops/sec
not_simple_master: 524 ±2% (515–532) ops/sec
not_simple_direct: 529 ±2% (521–537) ops/sec
not_simple_intersect: 180 ±2% (177–183) ops/sec
find_complex_master: 483 ±2% (476–491) ops/sec
find_complex_direct: 743 ±1% (732–754) ops/sec
find_complex_intersect: 477 ±2% (470–485) ops/sec
not_complex_master: 440 ±2% (433–447) ops/sec
not_complex_direct: 393 ±2% (386–399) ops/sec
not_complex_intersect: 441 ±2% (433–449) ops/sec The current code is taking a huge performance hit vs. always using only |
Nice benchmark! I still like the idea of simplifying the code as well. |
+1 for simplifying |
For both simple and complex selectors, use direct filter in winnow Closes jquerygh-3272
For both simple and complex selectors, use direct filter in winnow Closes jquerygh-3272
Per https://github.com/jquery/jquery/pull/3261/files/c1339665c27440a23a5576ca1dfdad9c38567288#r74370245 , the complexity of separate branches for simple vs. non-simple selectors doesn't seem worthwhile. Both of them should defer directly to
jQuery.filter
.The text was updated successfully, but these errors were encountered: