From 213f4285ca87b65eb7c815d6f41be6e71f056841 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 25 Feb 2015 17:09:47 -0500 Subject: [PATCH] Updated Launch and filter lists load performance (markdown) --- Launch-and-filter-lists-load-performance.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Launch-and-filter-lists-load-performance.md b/Launch-and-filter-lists-load-performance.md index 4e5387d..e70aaa6 100644 --- a/Launch-and-filter-lists-load-performance.md +++ b/Launch-and-filter-lists-load-performance.md @@ -1,9 +1,17 @@ +Parsing raw filter lists is a CPU and memory intensive task. Adblock Plus-compatible filter syntax is complex, and thus parsing those filters requires a lot of CPU cycles. To add to the parsing complexity, µBlock also supports the parsing of hosts files. Though µBlock could parse filter lists at a satisfying speed, this doesn't mean trying to improve performance in that area should not be attempted. + +So this is what has been done in 0.8.9.0. The idea is rather simple: create a compiled version of a filter list, so that next time it needs to be loaded in memory, all the costly parts of the parsing operation has been done already: + ![Figure 1](https://raw.githubusercontent.com/gorhill/uBlock/master/doc/benchmarks/setup-performance-internals.png) - +The compiled version of a filter list is contains very deterministic content, such that no complicated parsing is required. This improves launch time performance (smaller is better): ![Figure 2](https://raw.githubusercontent.com/gorhill/uBlock/master/doc/benchmarks/setup-performance-0.8.9.0.png) +And this also improve the performance when filter lists have to be reloaded: +![Figure 3](https://raw.githubusercontent.com/gorhill/uBlock/master/doc/benchmarks/filters-load-performance-0.8.9.0.png) -![Figure 3](https://raw.githubusercontent.com/gorhill/uBlock/master/doc/benchmarks/filters-load-performance-0.8.9.0.png) \ No newline at end of file +A compile filter lists is made of a sequence of _atomic_ filter, i.e. a filter which is not composite. ABP-compatible filter syntax allows the creation of composite filters, i.e. filter declarations which really represents many filters. For example: + + \ No newline at end of file