Comments (2)
Idea: test only against the nodes which have not been tested yet, this means will need to keep the untested nodes around until they are tested. First untested node is document.body
. Sounds very promising.
from ublock.
Testing only changed nodes didn't work too well. Actually, it worked well for the test site I used, quite heavy si.com, but it didn't work well with a lighter site, jshint.com, because a whole lots of nodes are created for this one, and I got the reverse result in this case. So I tried something else, which is to split the generic filters into two groups, the highly generics, and the lowly generics. The lowly generics are the one in the form (regex):
/^(([a-z]*)\[(alt|title)="([^"]+)"\])$/
For examples:
[title="Get Posts On Facebook Wall"]
a[alt="Follow Us on Twitter"]
a[title="Subscribe on FriendFeed"]
img[alt="Share on Twitter"]
img[title="Share at Google+"]
The highly generics are anything else than the above, for examples:
[class^="social_button_"]
a[href^="http://www.adxpansion.com"]
div[id^="div-gpt-ad-"]
A fast dictionary approach can be used for the lowly generics, and for the high generics, same approach as before is used. Nice side-effect aside the ~30% performance gain, less irrelevant rules are likely to be injected (not that this was an issue given the already low likelihood).
Above is si.com, reloaded 8 times -- so divide overhead introduced by uBlock seen in the pic by 8 to get average added overhead for top culprit calls (for rather demanding si.com). So before changes, overhead per-page load was 92ms, after it was less than 60ms (for front page of quite demanding si.com that is).
from ublock.
Related Issues (20)
- False flag
- This line is preventing us from using feature toggles HOT 1
- Annoying uBlock pop-up on youtube search bookmark HOT 2
- paypal-communication.com is blocked by uBlock
- CPU pegged at 100% / bad performance
- myfilters not working
- overflow: hidden when blocking elements, impossible to scroll webpage HOT 1
- why is this hiding video thumbnails??
- !!! ALERT - THIS IS AN UNOFFICIAL VERSION !!! PLEASE READ BEFORE POSTING A NEW ISSUE HERE !!! ALERT - THIS IS AN UNOFFICIAL VERSION !!! HOT 1
- Just a question
- how to block css? HOT 1
- Issue: CMP is being blocked by uBlock HOT 5
- uBlock-LLC, @chrisaljoudi and AdBlock are scum for misleading people and making money off of stolen work and brand
- How to block this chinese novel website ads HOT 13
- Warning: This repo is fake - Do NOT open an issue here for uBlock Origin HOT 2
- * * * allow doesn't work HOT 1
- Why toxic trolls/psychos: @uBlock-user and @gorhill have not been banned for their disruptive repetetive abusing other people??
- Albertsons.com video content blocked by uBlock HOT 2
- ublock.org is a shit HOT 1
- Embedded tweets disappeared
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ublock.