Live data from Hacker News

Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%

brave.com

161–170 of 289 posts

Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%

#161
post #160

Why don't Mozilla make or use such engine in its browser? Make something really native for dealing with ads and annoyances. The irony is Brave smartly uses Rust which were forsaken by Mozilla. I know Mozilla seems to have something for ads but honestly I don't even know what it really does, beside its shield icon.

Because ad blocking isn't provided by default in Firefox. It isn't as opinionated as Brave, for the better and the worse.

Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%

#162
post #160

Why don't Mozilla make or use such engine in its browser? Make something really native for dealing with ads and annoyances. The irony is Brave smartly uses Rust which were forsaken by Mozilla. I know Mozilla seems to have something for ads but honestly I don't even know what it really does, beside its shield icon.

Because Mozilla is mostly sponsored by Google.

Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%

#163
post #29

Is Brave still a front for a cryptocurrency pump-and-dump scheme?

Never was.

plenty of other issues though:

https://news.ycombinator.com/item?id=18734999

https://www.sophos.com/en-us/blog/brave-ceo-apologises-for-a...

https://www.bleepingcomputer.com/news/security/facebook-twit...

and issues with tor (presumably fixed by now)

https://www.coindesk.com/tech/2021/02/22/brave-browser-was-e...

Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%

#164

Earlier quoted context omitted.

if I recall correctly Rust does not support any form of dynamic linking or library loading. Most of the community I’ve interacted with are big on either embedding a scripting engine or WASM. Lots of momentum on WASM based plugins for stuff. It’s a weakness for both Rust and Go if I recall correctly

It does support dynamic libs, but virtually all important Rust software seems to be written without any consideration for it.

RAM is cheap mmmkay?

Or at least it used to be when they designed the thing…

Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%

#165
post #160

Why don't Mozilla make or use such engine in its browser? Make something really native for dealing with ads and annoyances. The irony is Brave smartly uses Rust which were forsaken by Mozilla. I know Mozilla seems to have something for ads but honestly I don't even know what it really does, beside its shield icon.

Almost all of Mozilla's money comes from Google, an ad company. Mozilla wouldn't want to bite the hand that feeds them.

Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%

#166
post #151
post #24

I am surprised there does not exist a community fork of Brave yet that strips out all of the commercial stuff (rewards, AI, own updates), making it suitable for inclusion in the repos of mainstream free/libre Linux distros.

Isn't this what Helium is doing? I have been using it as daily driver for half a year, works a charm. Only would like better 1Password integration.

Helium is based on ungoogled-chromium. It enables manifest v2 by simply reverting some code changes made by google. So, if google decides to remove manifest v2 wholly, helium will also lost its ublock original support.

Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%

#167
post #62

Earlier quoted context omitted.

Edit: I misremembered a Rust crates capability (pre- and post-install hooks), so my comment was useless and misleading.

Aren't procedural macros amd build.rs arbitrary code being executed at build time?

Pretty much, yes. And they don’t have much as far as isolation goes. It’s a bit frightening honestly.

It does unlock some interesting things to be sure, like sqlx’ macros that check the query at compile time by connecting to the database and checking the query against it. If this sounds like the compiler connecting to a database, well, it’s because it is.

Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%

#168

Earlier quoted context omitted.

FlatBuffers was definitely the majority of the improvements here! On 64-bit systems, pointers themselves can really start to take up a lot of memory (especially if you multiply them across 100k+ adblock filters). Switching to array indices instead of pointers saves a lot of memory that's otherwise wasted when you don't need to address the entire possible memory space.

Insightful. Many thanks. Flat buffers is know to bloat client code. Was any trick used to mitigate that?

I guess code bloat is proportional to schema complexity, and performance improvement is proportional to volume, so in ad blocker with many large block lists the latter dominates.

Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%

#169
post #138

I like Brave but the only thing that keeps me from using it on mobile is the lack of extension. That's why Firefox is my daily driver on Android

And here I am on IOS where Brave but not Firefox can use adblockers. My fucking god I’m not sure enshittification has ever been so widely dispersed. It’s impossible to have any type of unified set up across different OS/devices currently.

Kagi's Orion on iOS is good, and supports ff/chrome extensions

Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%

#170

Earlier quoted context omitted.

It does support dynamic libs, but virtually all important Rust software seems to be written without any consideration for it.

RAM is cheap mmmkay? Or at least it used to be when they designed the thing…

Is it a RAM problem though? My understanding is that each process loads the shared library in its own memory space, so it's only a ROM/HDD space problem.
Post reply on HN