Brave announced today that it has improved the memory usage of its internal content blocker significantly. The company claims that it has reduce memory usage by about 75 percent, which equates to a reduction of about 45 megabytes on all supported platforms.
Brave says that users who have enabled additional filters will see an even larger reduction in memory usage going forward.
How it managed to do that? Brave explains:
we achieved this major memory milestone by iteratively refactoring the adblock-rust engine to use FlatBuffers, a compact and efficient storage format. This architectural transition allowed us to move the roughly 100,000 adblock filters shipped by default from standard, heap-allocated Rust data structures (such as Vecs, HashMaps, and structs) into a specialized, zero-copy binary format.
Brave notes that it has implemented several optimizations in addition). These are:
- Memory management: Used stack-allocated vectors to reduce memory allocations by 19% and improved building time by ~15%.
- Matching speed: Improved filter matching performance by 13% by tokenizing common regex patterns.
- Sharing resources: Resources are shared between instantiations of adblock engines, saving ~2 MB of memory on desktop.
- Storage efficiency: Optimized internal resource storage memory by 30%.
The main memory reduction and optimizations landed in Brave 1.85 while additional optimizations will be included in the next release of the browser.
Brave slashes memory use of its ad-blocker by at least 45 megabytes on all platforms - Chipp.in Tech News and Reviews
Brave Browser is one of the few major web browsers that supports native content blocking on all supported platforms that is enabled by default. It...
chipp.in

