mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-15 07:22:28 +02:00
725e6931f5
The original motivation is to further speed up launch time for either non-selfie-based and selfie-based initialization of the static network filtering engine (SNFE). As a result of the refactoring: Filters are no longer instance-based, they are sequence-of- integer-based. This eliminates the need to create instances of filters at launch, and consequently eliminates all the calls to class constructors, the resulting churning of memory, and so forth. All the properties defining filter instances are now as much as possible 32-bit integer-based, and these are allocated in a single module-scoped typed array -- this eliminates the need to allocate memory for every filter being instantiated. Not all filter properties can be represented as a 32-bit integer, and in this case a filter class can allocate slots into another module-scoped array of references. As a result, this eliminates a lot of memory allocations when the SNFE is populated with filters, and this makes the saving and loading of selfie more straightforward, as the operation is reduced to saving/loading two arrays, one of 32-bit integers, and the other, much smaller, an array JSON-able values. All filter classes now only contain static methods, and all of these methods are called with an index to the specific filter data in the module-scoped array of 32-bit integers. The filter sequences (used to avoid the use of JS arrays) are also allocated in the single module-scoped array of 32-bit integers -- they used to be stored in their own dedicated array. Additionally, some filters are now loaded more in a deferred way, so as reduce uBO's time-to-readiness -- the outcome of this still needs to be evaluated, time-to-readiness is especially a concern in Firefox for Android or less powerful computers. |
||
---|---|---|
.. | ||
_locales | ||
css | ||
img | ||
js | ||
lib | ||
web_accessible_resources | ||
1p-filters.html | ||
3p-filters.html | ||
about.html | ||
advanced-settings.html | ||
asset-viewer.html | ||
background.html | ||
cloud-ui.html | ||
dashboard.html | ||
document-blocked.html | ||
dyna-rules.html | ||
logger-ui.html | ||
no-dashboard.html | ||
popup-fenix.html | ||
popup.html | ||
settings.html | ||
shortcuts.html | ||
support.html | ||
whitelist.html |