"ad blockers checks these requests against large lists to determine what should not be let through." - if it's a performance hit, perhaps the Chrome developers should be introduced to SQL databases? It should just like the kind of job they were designed to do. And in-memory databases are very fast.
In Rust we trust: Brave smashes speed limit after rewriting ad-block engine in super-lang
Software engineers working on the Brave browser have rewritten the browser's ad blocking engine in Rust and seen massive speed increases as a result. In a blog post on Wednesday, Brave Software performance researcher Andrius Aucinas and chief scientist Ben Livshits said that rewriting Brave's built-in ad blocker in Mozilla- …
COMMENTS
-
-
Friday 28th June 2019 08:09 GMT Anonymous Coward
You think Chrome developers have a REAL reason for removing that API? They just need an excuse for handicapping its ability to block ads.
Google wanting Chrome to do a good job of blocking ads is as unlikely as Pfizer wanting to invent a drug to cure a disease, instead of a drug to treat it.
-
-
Friday 28th June 2019 21:17 GMT Anonymous Coward
Pfizer sell antibiotics...
Which is a perfect example, since they aren't a permanent cure (i.e. if you get some type of infection and the antibiotics cure you, you can still be re-infected) and as organisms have become resistant to generic antibiotics there is now a need for new patented antibiotics to replace them!
-
-
-
-
-
Saturday 29th June 2019 10:42 GMT Dave K
Without a doubt. Another red techie site I use is a classic example. Without ad-blocking, pages take ages to load, hundreds of connections to 3rd party sites rattling through, content jumping around all over the place as ads continually load everywhere, etc. With unlock, the pages just load in under a second.
Claiming performance concerns for ad-blockers is a bit like claiming that a 4l 500hp engine is bad for performance because it weighs more than a 1.4l 100hp engine...
-
-
-
Friday 28th June 2019 08:34 GMT Charlie Clark
Re: Probably rewriting it they rewrote it right...
Possibly, though the people I talk to who use Rust appreciate it because it means they avoid the pitfalls in C/C++ without thinking, and it can produce impressively small binaries. Any good programmer worth their salt should appreciate whatever help the compiler can give them.
-
Friday 28th June 2019 08:50 GMT tiggity
Re: Probably rewriting it they rewrote it right...
Language design makes a difference, but even for a particular language compiler can make a surprisingly big difference.
I remember back in the day when the MS C/C++ compiler was renowned for producing big and slow binaries compared to far lesser known specialist compilers. (as well as other big name compilers e.g. Intel)
Not coded with C/C++ for many years so not sure if MS has got its act together or if the niche competitors folded under the onslaught of the Visual Studio juggernaut)
-
Friday 28th June 2019 10:12 GMT Anonymous Coward
Re: Probably rewriting it they rewrote it right...
Back when I had a choice of compilers (and the choice was only MSVC or Borland) I found MSVC to produce the fastest code by a significant margin and usually smaller than Borland too (and also not crashing at random or doing bizarre things with disk caching like Borland-compiled stuff was prone to do).
I once set a challenge to my team to see if they could hand-code some assembler to beat a function I'd written in C and compiled with MSVC and they couldn't. Of course, I might have had a rubbish team...
-
Friday 28th June 2019 16:25 GMT JohnFen
Re: Probably rewriting it they rewrote it right...
"I once set a challenge to my team to see if they could hand-code some assembler to beat a function I'd written in C and compiled with MSVC and they couldn't."
Whether or not you can hand-code assembly that is more efficient than C depends on a few things independent of the compiler. It depends on what you're counting as "beating" (I assume that you mean speed here), and it depends on the nature of the program itself.
C is a mid-level language, and for many sorts of tasks, even a mediocre C compiler can produce code that is on par with assembly. However, for other tasks (particularly ones that are complex enough to require the use of higher-level C library functions), you can beat even the best C compiler with assembly.
This is a prime example of why it's a mistake to settle on any one language as "the best". Which language or approach is best is greatly dependent on precisely what the task you're doing is.
-
This post has been deleted by its author
-
Friday 28th June 2019 19:04 GMT Anonymous Coward
Re: Probably rewriting it they rewrote it right...
There was a time when MS was the worst - IIRC late 80s or early 90s, and surpassed by Borland, Intel, Watcom - the latter highly regarded.
MS understood the risks of losing control, and worked hard to turn the table. Meanwhile Borland went down the sink (many mistakes on their own, and no little help from MS) and its compilers suffered a lot.
Watcom was a small company, and was bought by others.
Hand-optimized assembler is far harder these days, it does require a fairly advanced knowledge of how a given CPU works, to choose and put instructions together.
-
-
Friday 28th June 2019 18:04 GMT pavel.petrman
Regarding "not sure if MS has got its act together"
Well, performance is acceptable to very good. Only MSVC still comes from Microsoft which means tons of little pain-in-the-arse moments whenever a new version comes out (they keep switching back and forth in some important and impactful areas).
-
-
Friday 28th June 2019 08:53 GMT horse of a different color
Re: Probably rewriting it they rewrote it right...
I've started to learn Rust, and I disagree that it generates small binaries - from my experience the binaries are larger than corresponding C++ programs, and you have to invest some effort in making them smaller. Other than that, it is very fast and efficient.
-
-
Friday 28th June 2019 09:09 GMT Paul Crawford
Re: Probably rewriting it they rewrote it right...
Indeed, as a 69 times speed increase (no sniggering back there - not tested on "speciality" web sites at all) is not what you would expect from comparing languages of similar style.
Against JavaScript or Python a factor in the region of ten/hundred makes sense, yes, but not against C/C++/FORTRAN and similar where compiler/language differences of 2-3 times are all one might expect (unless the original implementation was a VERY poor design).
-
Friday 28th June 2019 10:23 GMT ibmalone
Re: Probably rewriting it they rewrote it right...
Yes, from the actual blog post:
"We therefore rebuilt our ad-blocker taking inspiration from uBlock Origin and Ghostery’s ad-blocker approach. This focuses on a tokenization approach specific to ad-block rule matching against URLs and rule evaluation optimised to the different kinds of rules."
Different algorithm, so the speed-up is not due to changing to Rust. Of course if Rust was a dog compared to C++ that could easily kill the speed increase from the re-design (some interpreted languages are much slower than simple compiled languages, and some are only a little slower), but it's not so it doesn't.
-
Friday 28th June 2019 10:45 GMT karlkarl
Re: Probably rewriting it they rewrote it right...
Exactly. From my experience Rust and C++ (with safety features like shared/weak pointers, etc) generate very similar assembly.
Rust is fast (very close to safely written C++) but it can't really be faster unless there are errors in an implementation / standard library.
Plus chuck in the idea that there are about 15 decent C++ compilers (more throughout the ages) and 1 Rust one; the idea that their first attempt is "perfect" doesn't quite sound feasible.
-
-
-
-
-
Friday 28th June 2019 10:05 GMT GregC
Re: Lost cause
Trying to kill ad-blocking is surely a lost cause, ultimately. You can't force people to look at something they don't want to look at. Can you?
Not saying this is a direction we're being herded in or anything.
Anyway, Brave sounds interesting - hadn't heard of it before. Definitely going to take a look.
-
Friday 28th June 2019 15:47 GMT oiseau
Re: Lost cause
Brave sounds interesting - hadn't heard of it before. Definitely going to take a look.
Yes ...
Better do that first:
https://securityboulevard.com/2019/02/brave-browser-sacrifices-security/
https://cointelegraph.com/tags/brave-browser
Not everything that seems to or is said to glitter is gold.
Usually nothing is.
Cheers,
O.
-
Friday 28th June 2019 11:27 GMT Doctor Syntax
Re: Lost cause
"You can't force people to look at something they don't want to look at."
Maybe, maybe not, but succeeding in at least shoving it in front of them is going to be counter-productive. But, as I keep saying, the advertising industry is only interested in selling advertising, not its clients' products.
-
-
-
Friday 28th June 2019 14:49 GMT Jim Mitchell
Re: Always wanted to get into rust...
The funny thing is that you don't get tetanus from "rust", you get tetanus because the nail was rusty because it was in the dirt, where the tetanus causing bacteria live. You can stick yourself with rusty nails all day, just as long as they're from your damp basement instead of being buried in the backyard.
-
-
Friday 28th June 2019 12:19 GMT Lord Buddha
Firefox + Ghostery vs Brave Browser
Just tried brave browser on Linux.
Brave: Version 0.65.121 Chromium: 75.0.3770.100 (Official Build) (64-bit)
FireFox: Version 67.0.4 Ghostery 8.3.4
Linux: Ubuntu: 19.04 with kernel 5.1.3-050103-generic
On the sites I tried, Firefox was faster and more trackers were blocked (less requests were made).
Love Rust though.
-
-
Friday 28th June 2019 16:37 GMT slartybartfast
Re: When is someone going to come up with a stealth ad. blocker?...
The site independent.co.uk now refuses to let you use it with an ad blocker installed. Once you disable your blocker, it bombards you with a tonne of ads, including large ones down both the left and right edges. I did figure out using Firefox’s tracker blocker, whilst whitelisting the site in the ad blocker plugin I’m using stops the ads showing. No such luck with Opera though.
-
Friday 28th June 2019 17:23 GMT Anonymous Coward
Re: independent.co.uk now refuses to let you use it with an ad blocker installed.
"The site independent.co.uk now refuses to let you use it with an ad blocker installed."
That's a shame, isn't it. It presumably makes it trickier to refer to the 2013 article on independent.co.uk which was headlined
"Embarrassment for rising star of Labour and betting shop critic Chuka Umunna after he accepts £20,000 gift from gambling executive
Close ally of Ed Miliband accused of hypocrisy by the Tories."
It used to be readily available at https://www.independent.co.uk/news/uk/politics/embarrassment-for-rising-star-of-labour-and-betting-shop-critic-chuka-umunna-after-he-accepts-20000-8748755.html
Well, your constituency supporters wouldn't want to forget it so soon would they Mr Umunna, so here's a little bit more from the article:
"Chuka Umunna, a rising star of the shadow Cabinet, faces embarrassment after it emerged he received a £20,000 gift from an emeritus gambling executive at the same time as campaigning against the proliferation of betting shops in his constituency.
Mr Umunna, who is widely regarded as a future Labour leader, accepted the donation from Neil Goulden, the chairman emeritus of the Gala Coral Group, which owns more than 1,700 bookmakers."
Change UK, OK, Chuka.
https://www.theyworkforyou.com/mp/24950/chuka_umunna/streatham
The Independent Group. It is. Are you?
-
-
-
Saturday 29th June 2019 23:38 GMT RLWatkins
That's a couple of pretty misleading lead paragraphs there.
They did not achieve a 69X increase in performance because they re-wrote it in Rust. Indeed, for a given algorithm Rust is no faster than C++.
They achieved a 69X increase in performance because they replaced a lousy algorithm with a good one. Rust had nothing to do with that.
-
Saturday 20th July 2019 21:17 GMT anoncow
Re: That's a couple of pretty misleading lead paragraphs there.
"Rust had nothing to do with that"
You don't know that. Sometimes a language platform will make a given approach practical and pleasant to implement, compared to tedious in some other language. This effect is seen regularly when migrating a project from C to C++, though you would never be able to convince a dyed in the wool C diehard of that.
-