-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Leverage whotracks.me's huge dataset of URLs for benchmark purpose
As seen at: https://whotracks.me/blog/adblockers_performance_study.html The requests.json.gz file can be downloaded from: https://cdn.cliqz.com/adblocking/requests_top500.json.gz Copy the file into ./tmp/requests.json.gz If the file is present when you build uBO using `make-[target].sh` from the shell, the resulting package will contain `./assets/requests.json`, which will be looked-up by the method below to launch a benchmark session. From uBO's dev console, launch the benchmark: µBlock.staticNetFilteringEngine.benchmark(); The usual browser dev tools can be used to obtain useful profiling data, i.e. start the profiler, call the benchmark method from the console, then stop the profiler when it completes. Keep in mind that the measurements at the blog post above where obtained with ONLY EasyList. The CPU reportedly used was: https://www.cpubenchmark.net/cpu.php?cpu=Intel+Core+i7-6600U+%40+2.60GHz&id=2608 Rename ./tmp/requests.json.gz to something else if you no longer want ./assets/requests.json in the build.
- Loading branch information
Showing
2 changed files
with
72 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5733439
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The report claims Ghostery to be a better performant in the benchmarks for the most part. Is it true ?
5733439
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, I didn't check myself -- but there is no reason to believe it's not true.
In general, if you can convert string-based processing into typed array processing, it essentially means you convert string processing into number crunching, which should typically be faster. They claim "Filters are stored in a very compact form, in typed arrays", so that would explain the better performance.
On my side this is what I am trying to do piecemeal (HNTrie, the new PSL), but to convert all of the static filtering engine to be typed array-based is more of a long term effort. In any case, I think that the ability to benchmark outside browsing web pages will allow me to identify places to improve (marginally really, there is a point where little can be done). I currently get an average of ~20µs per request on my side -- I consider this pretty knowing it's mostly JS code after all.
What surprise me more is the result concerning ABP, so I will try to harness the same benchmark method above inside ABP's extension code to see what's going on. I just downloaded and launched the latest ABP dev build from the Chrome store and there seems to be severe regression regarding memory usage. Whereas uBO sit at less than 35 MB with only EasyList, ABP was over 100 MB.
5733439
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. I finally hooked the benchmark to ABP's in-extension filtering engine and the results do not match what the blog post is reporting. I get an average of 45µs with ABP -- top=ABP, bottom=uBO:
5733439
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback from @remusao:
https://gist.github.com/remusao/ca53fc9facaf882704044064e4b2d83f