brave/adblock-rust

Optimize regexp memory usage

Closed this issue · 0 comments

From brave/brave-browser#21603 (comment)

Adblock filters take +40Mb (Private Memory Footprint) even without extra filters.
Most of that memory is consumed by heap allocation with the stack brave/brave-browser#21603 (comment)

35MB is taken by HashMaps that store NetworkFilter. Each NetworkFilter takes ~400 bytes which looks much more than the text version.
The most expensive field is regexp.