- Brave browser ad-blocker features new engine implementation in Rust programming language
- The new engine promises 69x performance over the current engine
- The new engine allows web compatibility issues to be handled better and faster
In a blog post on June 26, 2019, Brave Software, Inc, the firm in charge of the privacy-centric Brave browser announced that the performance of the ad-blocker on its Brave browser has been improved by 69x using a new engine implementation in Rust, a multi-paradigm system programming language focused on safety and safe concurrency. The latest implementation is designed to boost the speed of the browser when accessing web pages.
Improved Performance of Brave Browser’s Ad-Blocker
Per the blog post, Brave Software, Inc. has improved the performance of the advertisement blocker on the Brave browser by 69x using a new engine implementation written in the Rust language.
There was a need for improvement because Brave Shields are an important part of the browser and they protect users’ privacy from trackers and ads by handling every web request that is needed to load a website.
The team says 75 requests are usually required to load a webpage and each of these requests has to be checked against tens of thousands of rules (for accepting or blocking a request) which calls for an efficient ad-blocker.
While the C++ programming language which the ad-blocker was written in could handle these requests swiftly, it was discovered that the speed of the browser can be boosted significantly up to 69 times on the average if written in Rust.
Similarly, the cost of running certain extensions which use a WebRequest API to inspect and block undesired requests was not a limitation for Brave because the browser’s requests are handled natively, within the browser’s network stack.
The Need for Speed
Despite Brave’s speed and advantage over these extensions, there was still a need to improve its performance.
The latter was, therefore, made possible by building a new ad-blocker engine using Rust programming language which Brave claims is a performant language that is compilable to its native code and it is suitable for execution within the native browser core.
The team claims the 69x increment in speed and performance of the new engine was verified using a 2018 MacBook Pro laptop featuring a 32GB RAM and 2.6 GHz Intel Core i7 processor.
Users can also test the new features on the Dev channel and Nightly channel versions of Brave browsers starting from today.
According to Brave, it had previously determined the cost of ad blocking in comparison to the ad blocking list and rules that were not used.
The previous algorithm it had employed used a Bloom Filter data structure to allow a majority of requests to pass through without blocking, even though these requests were tracked in fragments that could be matched before those that are clean are quickly ruled out.
On the contrary, the new algorithm which is faster was inspired by quickly eliminating rules that are not likely to match a request after a search has been made.
As a result, the algorithm’s set of rules are 69x faster on average than the current engine and the new engine supports more of the filter rule syntax which allows web compatibility issues to be handled better and faster.
On June 25, 2019, Blockchain Reporter informed of the Brave browser’s intending integration with Ethereum wallet, Ledger, and Trezor hardware wallets.