1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 12:57:57 +02:00
uBlock/platform/chromium
Raymond Hill ed7e34fb07
Refactor selfie generation into a more flexible persistence mechanism
The motivation is to address the higher peak memory usage at launch
time with 3rd-gen HNTrie when a selfie was present.

The selfie generation prior to this change was to collect all
filtering data into a single data structure, and then to serialize
that whole structure at once into storage (using JSON.stringify).

However, HNTrie serialization requires that a large UintArray32 be
converted into a plain JS array, which itslef would be indirectly
converted into a JSON string. This was the main reason why peak
memory usage would be higher at launch from selfie, since the JSON
string would need to be wholly unserialized into JS objects, which
themselves would need to be converted into more specialized data
structures (like that Uint32Array one).

The solution to lower peak memory usage at launch is to refactor
selfie generation to allow a more piecemeal approach: each filtering
component is given the ability to serialize itself rather than to be
forced to be embedded in the master selfie. With this approach, the
HNTrie buffer can now serialize to its own storage by converting the
buffer data directly into a string which can be directly sent to
storage. This avoiding expensive intermediate steps such as
converting into a JS array and then to a JSON string.

As part of the refactoring, there was also opportunistic code
upgrade to ES6 and Promise (eventually all of uBO's code will be
proper ES6).

Additionally, the polyfill to bring getBytesInUse() to Firefox has
been revisited to replace the rather expensive previous
implementation with an implementation with virtually no overhead.
2019-02-14 13:33:55 -05:00
..
is-webrtc-supported.html fix warnings in browser console 2017-07-25 11:59:52 -04:00
is-webrtc-supported.js this fixes https://github.com/gorhill/uBlock/issues/533#issuecomment-167931681 2015-12-31 09:24:55 -05:00
managed_storage.json #985: might be the missing trailing # 2015-11-27 14:30:17 -05:00
manifest.json fix reported extension error in Chrome 72.0.3622.0 2018-12-05 14:46:35 -05:00
vapi-background.js fix https://github.com/uBlockOrigin/uBlock-issues/issues/256; add regex support in logger filter field 2018-12-14 11:01:21 -05:00
vapi-client.js Minor generic code review of changes since 1.18.2 2019-02-02 08:09:34 -05:00
vapi-common.js Refactor selfie generation into a more flexible persistence mechanism 2019-02-14 13:33:55 -05:00
vapi-usercss.js guard against future instances of issue fixed in #3721 2018-05-03 09:55:36 -04:00
vapi-usercss.pseudo.js guard against future instances of issue fixed in #3721 2018-05-03 09:55:36 -04:00
vapi-usercss.real.js fix another case of https://github.com/uBlockOrigin/uBlock-issues/issues/167 2018-09-29 18:56:59 -04:00
vapi-webrequest.js Test presence of firefox instead of absence of chromium 2019-02-12 15:29:20 -05:00
vapi.js refactor some webRequest-related code (now that firefox legacy is out of the way) 2018-10-28 10:58:25 -03:00