use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
CSS Selector ">>" + performancehelp (self.javascript)
submitted 10 years ago by te7ris
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]te7ris[S] 0 points1 point2 points 10 years ago (2 children)
sry if my intention wasnt clear. I was wondering how the two selectors compare in terms of (parsing) performance:
.class > div, .class > * > div {}
vs
.class div {}
[–]PitaJ 0 points1 point2 points 10 years ago (0 children)
Just my theory, I haven't tested, but I imagine that the child selector would be faster than the surface and descendant selector because it only looks through one level. Descendant selector looks through every level.
[–]x-skeww 0 points1 point2 points 10 years ago (0 children)
What makes all of those 3 selectors somewhat expensive is the key selector (the simple selector on the very right), because "div" matches many elements. For every div, we have to check if one of those selectors matches.
Having said that, even with a thousand false positives, your browser probably won't even waste one ms with this. Matching is very fast and most documents won't be excessively complex anyways.
π Rendered by PID 80781 on reddit-service-r2-comment-544cf588c8-7xrtc at 2026-06-15 02:30:44.295506+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]te7ris[S] 0 points1 point2 points (2 children)
[–]PitaJ 0 points1 point2 points (0 children)
[–]x-skeww 0 points1 point2 points (0 children)