Live data from Hacker News

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

brave.com

71–80 of 289 posts

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

#71
post #56
post #47

Earlier quoted context omitted.

> auditing your dependencies is How do you do that practically? Do you read the source of every single package before doing a `brew update` or `npm update`? What if these sources include binary packages? The popular Javascript React framework has 15K direct and 2K indirect dependencies - https://deps.dev/npm/react/19.2.3 Can anyone even review it in a month? And they publish a new update weekly.

More useful than reading the code, in most cases, is looking at who's behind the code. Can you identify the author? Do they have an identity and reputation in the space? Are you looking at the version of the package they manage? People often freak out about the number of packages in such ecosystems but what matters a lot more is how many different people are in your dependency tree, who they are, and how they operate…

[deleted]

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

#73
post #62

Earlier quoted context omitted.

At risk like node/npm with all the supply-chain attacks then? Or is there something that cargo does to manage it differently (due diligence?).

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?

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

#74
post #30

Earlier quoted context omitted.

> Or does it still replace them with ads for scanmy cryptocurrency? Brave never did that. Brave blocks third-party ads & trackers by default. (disclaimer: I lead privacy and adblocking at Brave)

lead what? https://archive.is/W0k4j (disclaimer: people remember how sketchy Brave is)

That was just a concept, it never made it to a live build AFAIK.

What they should have done instead is just take hundreds of millions of dollars from Google, like a non-sketchy browser.

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

#75

I'm not sure how impressed I should feel about saving 45 MiB these days.

Very, if only because you'd have said I'm not sure how impressed I should be about saving 4.5 MB these days not all that long ago. Remember when emacs was backronymised to 'eight megabytes and constantly swapping'? That was also not all that long ago. Now 8 megabytes is what some pissant JS library takes as part of some miserable npm package used to bellyflop an ad into your browser window.

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

#76
post #62

Earlier quoted context omitted.

At risk like node/npm with all the supply-chain attacks then? Or is there something that cargo does to manage it differently (due diligence?).

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

Rust crates run arbitrary code more often at build/install time than npm packages do.

Some people use 'pnpm', which only runs installScripts for a whitelisted subset of packages, so an appreciable fraction of the npm ecosystem (those that don't use npm or yarn, but pnpm) do not run scripts by default.

Cargo compiles and runs `build.rs` for all dependencies, and there's no real alternative which doesn't.

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

#77
post #66

Earlier quoted context omitted.

> The popular Javascript React framework has 15K direct and 2K indirect dependencies - https://deps.dev/npm/react/19.2.3 You’re looking at the number of dependents . The React package has no dependencies. Asides: > Do you read the source of every single package before doing a `brew update` or `npm update`? Yes, some combination of doing that or delegating it to trusted parties is required. (The difficulty should info…

> You’re looking at the number of dependents. The React package has no dependencies. Indeed. My apologies for misinterpreting the link that I posted. Consider "devDependencies" here https://github.com/facebook/react/blob/main/package.json As far as I know, these 100+ dev dependencies are installed by default. Yes, you can probably avoid it, but it will likely break something during the build process, and most people…

> As far as I know, these 100+ dev dependencies are installed by default.

devDependencies should only be installed if you're developing the React library itself. They won't be installed if you just depend on React.

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

#78
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.

Rust crates can run arbitrary code at build time: https://doc.rust-lang.org/cargo/reference/build-scripts.html

Geez, thank you.

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

#79
post #41
post #21

Does Brave actually block ads now? Or does it still replace them with ads for scanmy cryptocurrency?

Unlike other reply, I do not work at Brave, and I can also confirm that Brave never did that. They do have their own ads but those have always been opt in (you are not opted in by default), and they do pay some small amount of USD in their crypto token for opting in to those - it's pennies. People scoff at the pennies but guess who pays out nothing to show you ads against your will - literally everyone else. What you…

> the browser would rewrite the URL to contain their affiliate link

In fairness, that is incredibly shady and they deserve this mistrust even years later because of it.

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

#80
post #12
post #6

Earlier quoted context omitted.

A $130 Motorola smartphone has 8GB of RAM. This will save 0.5% RAM. It's fairly negligible on modern systems.

Now multiply that across all apps/services/extensions/profiles and it adds up. This kind of lazy thinking is why today’s software is so bloated and slow.

It's just Brave browser, you don't multiply by the number of every kind of service
Post reply on HN