-
Notifications
You must be signed in to change notification settings - Fork 2
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
Selector Performance #25
Comments
In a 250 post thread, Using .stub + .replacedSideArrows,
.stub + .replacedSideArrows + .post
display none takes it under 2500µs. The original CSS /* .stub ~ * is probably a little too expensive $$$ - but it's there because
if json index is off and replies are shown, it covers all bases */
.stub ~ *
display none takes 21000µs. Is the 0.02 seconds (which is 4x slower than normal) in savings worth it? |
:where(b, strong, th, legend, .subject, .name) In a 400 post thread, 13500µs with 13106 match attempts but only 400 found. Without |
Also, some of those selectors are the original 4chan X CSS that loads, renders, then gets removed. |
Using https://isellsoap.github.io/specificity-visualizer/ I had to remove A lot of them are red because of poor naming conventions on 4chan X's side and are out of my control (inconsistent naming, lack of generic classes). Some of them are probably my fault. |
https://blogs.windows.com/msedgedev/2023/01/17/the-truth-about-css-selector-performance/
After reading this article, ran it through the Edge DevTools.
Keep it mind that some of the selectors are actually from uBlock.
On page load seem to be the most expensive.
Other notable selectors are
Keep it mind this is with 4x CPU throttling, but faster CSS is faster CSS regardless of throttle.
Also to keep in mind is this appears to only really happen in threads with over 150 replies.
The text was updated successfully, but these errors were encountered: