New Update Brave slashes memory use of its ad-blocker by at least 45 megabytes on all platforms

lokamoka820

Level 41
Thread author
Verified
Top Poster
Well-known
Mar 1, 2024
3,074
3
9,893
3,969
Banana Republic
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.
 
This is basically a “data structure + representation” change: Brave moved its default filter set from normal Rust in-memory objects (lots of small heap allocations) into a compact, mostly read-only binary blob that can be accessed without copying.

What likely changed under the hood (why FlatBuffers helps)

With a typical adblock engine, the default lists (tens or hundreds of thousands of rules) get parsed into structures like vectors, hash maps, strings, regex objects, etc. That usually means:
  • Many heap allocations (each allocation has overhead and fragments memory)
  • Many duplicated strings / tokens
  • Extra copies when building and loading those structures

FlatBuffers is designed to store structured data in a compact binary format that can be “viewed” directly (zero-copy) rather than rebuilt into lots of heap objects. In practice, that can reduce:
  • Allocation count
  • Per-object overhead
  • Pointer-heavy graphs of objects (which are memory-inefficient)

So the “~75% / ~45 MB” claim is plausible specifically for the filter-engine data structures that were previously living as heap-allocated Rust collections.

How the other optimizations fit in

The bullet points you quoted are the “second-order” wins that usually come along once you refactor the core representation:
  • Stack-allocated vectors: fewer heap hits during parsing/building; typically improves both memory and build time.
  • Tokenizing common regex patterns: reduces expensive regex work and can speed matching (at the cost of extra engineering complexity).
  • Sharing resources between engine instances: avoids reloading/re-parsing the same data multiple times (useful if multiple profiles/contexts need an engine).
  • Optimized internal storage: often means tighter encoding, deduplication, smaller indices, and less wasted capacity in buffers.

Security / privacy angle (what this does and does not mean)

This is mainly a performance/memory improvement, not a “security breakthrough” by itself. A few practical points:
  • Lower memory usage can reduce overall browser pressure (less swapping / fewer slowdowns), which indirectly improves stability.
  • It does not automatically mean better blocking, fewer false positives, or stronger anti-tracking. That depends on the rules and matching logic, not only the storage format.
  • Any major refactor can introduce regressions. If users notice site breakage or weaker blocking after upgrading, it’s worth reporting to Brave with repro steps and the exact filter setup.

How to validate the claim on your own system (safe, practical checks)

If you want to see whether you personally benefit:
  • Confirm you’re on Brave 1.85 (or newer): open brave://version
  • Compare memory with the same session/profile and the same filter selections enabled/disabled
  • Use Brave’s task manager (Shift+Esc) and/or brave://memory-redirect (Chrome-style memory reporting) to compare before/after
  • If you use lots of extra filter lists, test with and without them, since Brave claims larger gains for “additional filters”

Bottom line

Brave’s explanation is consistent with a real-world way to cut memory: reducing heap-heavy in-memory representations and switching to a compact, zero-copy format. The most meaningful “user action” is simply to update to the version where it landed (1.85 per the article) and validate with consistent measurements if memory usage is a concern.

Sources
 
  • Like
Reactions: Sorrento
I wanted to comment in the other thread... but now it's gone... and this one is shorter.

45 MB is a drop in the ocean. :unsure:
Anyone who uses more than 3 extensions that are always enabled can get the same benefit by disabling at least 1 extension.
I'll leave aside the fact that Brave's internal adblocker doesn't have any advanced features that might interest users compared to other extensions.
 
I wanted to comment in the other thread... but now it's gone... and this one is shorter.

... aside the fact that Brave's internal adblocker doesn't have any advanced features that might interest users compared to other extensions.
That was true. Brave adblocker did not facilitate scriptlets in the beginning, but over the years they implemented most uBo and AG sciptlets.

For me the available scriptlets work well and I would not consider myself an advanced user, but medium level user.

Examples of uBo scriptlest working well:
  • foxnews.com##+js(ra, class, div[class*="gated-overlay"])
  • nu.nl##+js(rc, authorized-content, div.authorized-content, stay)
 
That was true. Brave adblocker did not facilitate scriptlets in the beginning, but over the years they implemented most uBo and AG sciptlets.

For me the available scriptlets work well and I would not consider myself an advanced user, but medium level user.

Examples of uBo scriptlest working well:
  • foxnews.com##+js(ra, class, div[class*="gated-overlay"])
  • nu.nl##+js(rc, authorized-content, div.authorized-content, stay)

An analysis with ChatGPT 5.2 shows the limitations compared to uBo but also with the AG Browser extension.
Anyone can make this comparison and ask the AI to create a table.

Obviously, without using Brave, I cannot refute any AI hallucinations.

Does Brave's log, if a serious log is available, have the ability to immediately display a personal rule excluded from applicability because you have entered an exception rule?

3.png
 
I don't think Brave allows generic script injection like *##+js(scriptlet). As posted Sampei-San I am not advanced but middle level adblock user. The effort and research you put into configuring additional security and privacy protection with scriptlets and TopLevelDomain exceptions is impressive.

I have a simple 2 profile approach a mild filtering approach (work profile) and a nuke-them apporach (surfing profile). Also Chromium based browsers like Brave can be made very secure by hardening the website permissions as posted here (link)
 
Last edited:
Brave Shields does allow users to create scriptlets as of early 2025, v1.75. If you omit the prefix, the rule will apply to all websites: ##+js(myscript.js)

Compared to Vivaldi adblocker, which one is more efficeint if using the exact same filter lists?
Vivaldi's adblocker is built on top of Chromium's content embedding APIs in C++. It works pretty well and at a low level compared to installable extensions.

Brave's Rust adblocker is unique: it runs natively in the browser's core, mainly blocking at the request stage. It is extremely optimized with advanced features like CNAME uncloaking.
 
Last edited:
Brave Shields does allow users to create scriptlets as of early 2025, v1.75. If you omit the prefix, the rule will apply to all websites: ##+js(myscript.js)


Vivaldi's adblocker is built on top of Chromium's content embedding APIs in C++. It works pretty well and at a low level compared to installable extensions.

Brave's Rust adblocker is unique: it runs natively in the browser's core, mainly blocking at the request stage. It is extremely optimized with advanced features like CNAME uncloaking.

(y)

Thank you for your reply.
So we have to wait for someone to demonstrate (if they want to, of course ;)) what I highlighted with uBo to verify whether the feature I requested is present, just out of curiosity.:)
 
(y)

Thank you for your reply.
So we have to wait for someone to demonstrate (if they want to, of course ;)) what I highlighted with uBo to verify whether the feature I requested is present, just out of curiosity.:)
I'm not an adblocking or even a Brave expert. Brave has improved noticeably in multiple areas recently, including the adblocker, which inspired me to adopt it as my everyday browser. I'm finding it more agreeable this time around. I do some reading to learn more about it here and there.

It used to be that Brave Shields was restricted to ABP syntax, but that's no longer the case.

Shields permits uBO syntax according to this official support article: How do I manage adblock filters in Brave?
Brave is broadly compatible with uBlock Origin's filter rule syntax. We encourage you to refer to the uBlock Origin Static filter syntax page.

Differences in compatibility are treated as bugs and are documented in the adblock-rust issue tracker.