gorhill / uMatrix

uMatrix: Point and click matrix to filter net requests according to source, destination and type
GNU General Public License v3.0
4.55k stars 470 forks source link

[Performance] Implement ability to snapshot memory to improve load times #935

Closed gorhill closed 6 years ago

gorhill commented 6 years ago

Memory snapshots (aka selfies) are not implemented in uMatrix -- unlike with uBO.

Implement:

This should improve load times, and memory usage, as seen with uBO.

gorhill commented 6 years ago

Benchmark is launch time with all stock hosts files selected, 84,857 distinct hostnames (8,322 duplicates were rejected but still needed parsing).

Before, 718.2 ms:
a

After, 127.6 ms: a

When loading from selfies, the peak memory at launch time is vastly reduced as per Chromium's Task manager: from slightly over 60 MB (garbaged-collected to ~32 MB) to 28 MB (garbage-collected to ~26 MB).