Funny that the iOS update notes don't mention this at all: > in this release: > Other enhancements, stability improvements, and security updates No mention of efficiency, or adblocking whatsoever!
Is the iOS version of Brave actually the same codebase? My understanding is that all browsers on iOS have to wrap Safari, which would explain the release notes. But I could be wrong here, as I don't develop for iOS.
Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%
51–60 of 289 posts
Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%
#52Earlier quoted context omitted.
Supply-chain attacks aren't really a property of the dependency management system Not having a dependency management system isn't a solution to supply chain attacks, auditing your dependencies is
> 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.
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 inform dependency choices.)
> What if these sources include binary packages?
Reproducible builds, or don’t use those packages.
Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%
#53Earlier quoted context omitted.
> these days Are you referring to current RAM prices or bloat of numerous Electron apps?
A $130 Motorola smartphone has 8GB of RAM. This will save 0.5% RAM. It's fairly negligible on modern systems.
The lesson here is pointer-chasing data structures and trees are a lot more expensive than everyone and most programming languages like to pretend they are.
Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%
#54Earlier quoted context omitted.
Supply-chain attacks aren't really a property of the dependency management system Not having a dependency management system isn't a solution to supply chain attacks, auditing your dependencies is
> 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.
(so yes, I'm stating that 99% of JS devs who _do_ precisely that, are not being serious, but at the same time I understand they just follow the "best practices" that the ecosystem pushes downstream, so it's understandable that most don't want to swim against the current when the whole ecosystem itself is not being serious either)
Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%
#55Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%
#56Earlier quoted context omitted.
Supply-chain attacks aren't really a property of the dependency management system Not having a dependency management system isn't a solution to supply chain attacks, auditing your dependencies is
> 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.
(The next most useful step, in the case where someone in your dependency tree is pwned, is to not have automated systems that update to the latest version frequently. Hang back a few days or so at least so that any damage can be contained. Cargo does not update to the latest version of a dependency on a built because of its lockfiles: you need to run an update manually)
Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%
#57Earlier quoted context omitted.
A $130 Motorola smartphone has 8GB of RAM. This will save 0.5% RAM. It's fairly negligible on modern systems.
OK now do the math for someone who has 200 tabs open. Remember that basically all browsers these days spin up one process per tab.
Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%
#58Earlier 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?).
You can use "cargo vendor" to copy-paste your dependencies C-style if you want to, and audit them all if you want. Mozilla does this for Firefox. Cargo does have lock files by default. But we really need better tooling for auditing (and enforcing tha auditing has happened) to properly solve this.
Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%
#59Does 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…
Re: Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%
#60Earlier quoted context omitted.
You can use "cargo vendor" to copy-paste your dependencies C-style if you want to, and audit them all if you want. Mozilla does this for Firefox. Cargo does have lock files by default. But we really need better tooling for auditing (and enforcing tha auditing has happened) to properly solve this.
I think the broader point being made here is that the C-style approach is to extract a minimal subset of the dependency and tightly review it and integrate it into your code. The Rust/Python approach is to use cargo/pip and treat the dependency as a black box outside your project.
So it's ultimately a trade off rather than a strictly superior solution.
Also, nothing in Rust prevents you from doing the same thing. In fact, I would argue that Cargo makes this process easier.