Home

Brave refurbishes Rust adblocking engine for reduced memory footprint

Brave Software has reworked its browser's Rust-based adblock engine to make it significantly more memory efficient and perhaps more secure. So you get fewer ads now with fewer MB of RAM.

According to Shivan Kaul Sahib, VP of privacy and security for Brave, company software engineers have been able to reduce memory consumption by around 75 percent since the reengineering began last year.

"The upgrade represents roughly 45 MB of memory savings for the Brave browser on every platform (Android, iOS and desktop) by default, and scales even higher for users with additional adblocking lists enabled," said Sahib in a blog post.

The benefits of reduced memory consumption include improved battery life and smoother multitasking, while also leaving more memory for other applications.

Brave's initial refactoring effort, as of June 2025, saw the memory footprint shrink from 150 MB to 121 MB. By October 2025, memory usage went from 119 MB to 108 MB. Presently, Brave puts its browser's memory footprint at 104 MB in version 1.85.118, down from 162 MB in version 1.79.118, released May 2025.

When The Register examined Brave version 1.85.118 under macOS Tahoe (26.1), the browser memory footprint upon reinstallation showed 121 MB in the built-in Task Manager. After fiddling with settings to ensure the browser's Leo AI assistant was completely disabled and restarting, the footprint dropped to 106 MB.

We note, however, that Brave's own screenshot shows an increase in the memory footprint of the GPU process, from 52.2 MB to 81.9 MB between the two versions being compared. 

"That is unrelated to the adblock engine memory improvements," Sahib told The Register in an email. "Such fluctuations in browser resource consumption across browser runs are extremely common; even the screenshot doesn't show exactly 45 MB of memory reduction, it actually shows a bigger decrease! 

"Performance measurement is heavily dependent on statistical averaging across multiple runs (which is what our improvement numbers indicate) and we don't have any evidence of a GPU footprint regression internally."

Brave has been able to eke out greater memory efficiency by incorporating FlatBuffers, a cross-platform serialization library initially created by Google for game development. It allows access to serialized data without unpacking or parsing – extra steps that add overhead.

"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," explained Sahib in his post.

Company engineers have also been integrating other improvements like stack-allocated vectors for better memory management, tokenizing common regex patterns for better filter matching performance, resource sharing among adblock engines, and optimized resource memory storage.

Sahib said Brave's adblock-engine has led to better performance and battery life on mobile devices, pointing to a series of related blog posts.

"The upshot is that blocking ads and trackers significantly improves user experience around page loading since fewer resources have to be downloaded," he said. "Brave has also built BatteryLab Device Evaluations for browser performance measurement across mobile devices."

Beyond the performance improvements, Rust has helped make Brave more secure.

"Rust makes entire classes of security and reliability bugs impossible," said Sahib. "Chromium (and so Brave) follows a Rule of Two for safely handling untrusted input from the Internet, and using a memory-safe language like Rust (for adblocking, or QR code generation) is a great way to increase trust in the safety of the browser."

Brave is not alone in its affinity for Rust code, popular these days because it manages to perform well while offering memory safety guarantees. Mozilla, where Rust was created, has implemented Rust code in Firefox and more so in its browser engine spin-off project Servo. Google is supporting the use of Rust in Chromium. And Microsoft is applying Rust more broadly.

Brave is also working on a variation of its browser called Brave Origin. It will require a one-time fee (but not on Linux) in exchange for the absence of sponsored images, Brave Rewards, Brave Wallet, Brave VPN, Leo, and telemetry. Security updates will be offered.

Sahib said Brave isn't yet ready to share a release date for Brave Origin. ®

Source: The register

Previous

Next