Live data from Hacker News

Clang Format Tanks Performance

travisdowns.github.io

101–110 of 156 posts

Re: Clang Format Tanks Performance

#101
post #94

Earlier quoted context omitted.

Rust is slower than C++?

Yes, at best 20% slower but can be far more slower if you hit worst case scenario.

Why is Mozilla Firefox written in Rust, then?

The last time I looked at browser benchmarks was in 2016 when Google released benchmarks to brag about its performance over Firefox and Edge. It appears Webkit has released JetStream2 to benchmark JavaScript, WebAssembly and web workers, among other things. But I can't find data showing Mozilla Firefox is ~20% slower than Chrome/Edge today.

Re: Clang Format Tanks Performance

#102

Earlier quoted context omitted.

Yes, at best 20% slower but can be far more slower if you hit worst case scenario.

Why is Mozilla Firefox written in Rust, then? The last time I looked at browser benchmarks was in 2016 when Google released benchmarks to brag about its performance over Firefox and Edge. It appears Webkit has released JetStream2 to benchmark JavaScript, WebAssembly and web workers, among other things. But I can't find data showing Mozilla Firefox is ~20% slower than Chrome/Edge today.

Using Firefox to evaluate Rust performance is probably not a good idea since only parts of it are written in Rust today.

But it's the first time I hear someone say that Rust is supposedly fundamentally slower than C++. I don't believe this to be a statement that can be substantiated, seeing that some of the fastest programs out there (ripgrep and hyper to name just two) are written in Rust.

Re: Clang Format Tanks Performance

#103
post #83

Earlier quoted context omitted.

> Some coding standards require sorting includes alphabetically Those are some pretty dumb coding standards if that's true. (I mean, yeah, the original fault is with the C preprocessor and the fact that header order matters, but since we're stuck with that, having those kinds of coding standards is pretty darn silly!)

Well given that the order of the headers matter, wouldn't it make sense to have the coding standard specify one true include order ? That's the only way to have a deterministic result.

That ties namespacing to performance, which just sounds horrible to deal with.

Re: Clang Format Tanks Performance

#104
post #94

Earlier quoted context omitted.

Rust is slower than C++?

Yes, at best 20% slower but can be far more slower if you hit worst case scenario.

Where did you pull those numbers?

Looking at https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

While the worst case is 40% slower (where even C perfored abysmally), most of the time the Rust is within a 10% margin of error, and in quite a few cases it's faster.

Re: Clang Format Tanks Performance

#105
post #96

I may eat downvotes but here's an honest opinion nonetheless: this article shows almost exactly why I wouldn't touch C++ with a ten-foot pole still, after running away screaming from it 11-12 years ago. Not saying it's an unique problem with C++'s tooling. I'm just saying that it has been my experience that one is much more likely to stumble upon such horrors while working with C++ as opposed to at least 7 other lang…

If you want to just get things done then this sort of complexity wouldn't impact you in the slightest using C++. You could just write code without needing to know this information. This is something for people really needing to squeeze performance out of systems. If you are looking for performance though, other languages have similar but different pitfalls and bits of esoteric knowledge that you need. Constructs that…

True. I am simply looking for a compiled not-far-away-from-C++ levels of performance language, plus one with the least amount of pitfalls / gotchas / WTFs to avoid. So far Rust seems to hit a sweet spot, although its style (procedural) and syntax leave much to be desired.

Re: Clang Format Tanks Performance

#106
post #95

I may eat downvotes but here's an honest opinion nonetheless: this article shows almost exactly why I wouldn't touch C++ with a ten-foot pole still, after running away screaming from it 11-12 years ago. Not saying it's an unique problem with C++'s tooling. I'm just saying that it has been my experience that one is much more likely to stumble upon such horrors while working with C++ as opposed to at least 7 other lang…

While Go and Elixir might indeed be slower, Rust is designed to generate optimal code and offer zero-cost abstractions like C and C++ and I would expect it to do so in this case.

That's what I keep hearing but here on HN periodically do pop up some benchmarks that show Rust being stomped.

But oh well, most benchmarks aren't pure or non-opinionated so there's that as well.

So far I like Rust quite a lot but -- as I said in another sibling comment -- its procedural style and syntax aren't stellar, in my eyes at least.

Re: Clang Format Tanks Performance

#107
post #94

I may eat downvotes but here's an honest opinion nonetheless: this article shows almost exactly why I wouldn't touch C++ with a ten-foot pole still, after running away screaming from it 11-12 years ago. Not saying it's an unique problem with C++'s tooling. I'm just saying that it has been my experience that one is much more likely to stumble upon such horrors while working with C++ as opposed to at least 7 other lang…

Rust is slower than C++?

I am undecided on it since I am not in the C++ ecosystem for a long time now, and I am just a beginner in Rust. I get the message there are ways to write suboptimal (in terms of performance) code in Rust as well but I also keep hearing there are much less ways to shoot oneself in the foot, which works very well for me.

Truthfully, even if Rust can be 2x-5x slower than C++ somewhere, I'll still choose it as my static-and-strongly-typed / compiled-to-machine-code language regardless. Least WTFs per minute is my most important metric.

But I am open to see any and all benchmarks which show both strengths and weaknesses of Rust. So far I sadly haven't seen many of them (but I've been mightily impressed by `actix` in the TechEmpower benchmarks!).

Re: Clang Format Tanks Performance

#108
post #102

Earlier quoted context omitted.

Why is Mozilla Firefox written in Rust, then? The last time I looked at browser benchmarks was in 2016 when Google released benchmarks to brag about its performance over Firefox and Edge. It appears Webkit has released JetStream2 to benchmark JavaScript, WebAssembly and web workers, among other things. But I can't find data showing Mozilla Firefox is ~20% slower than Chrome/Edge today.

Using Firefox to evaluate Rust performance is probably not a good idea since only parts of it are written in Rust today. But it's the first time I hear someone say that Rust is supposedly fundamentally slower than C++. I don't believe this to be a statement that can be substantiated, seeing that some of the fastest programs out there (ripgrep and hyper to name just two) are written in Rust.

IMO the jury is still out. I am pretty sure that C++ veterans that can cleverly utilise any and all performance tricks (minus resorting to an assembly language) and can thus beat any other language.

But I -- like yourself -- am much more interested in the applicability of a language in everyday tools, plus in getting the most performance with the least amount of dark magic involved.

BTW, `ripgrep` definitely made me work better and faster.

Re: Clang Format Tanks Performance

#109
post #95

Earlier quoted context omitted.

While Go and Elixir might indeed be slower, Rust is designed to generate optimal code and offer zero-cost abstractions like C and C++ and I would expect it to do so in this case.

That's what I keep hearing but here on HN periodically do pop up some benchmarks that show Rust being stomped. But oh well, most benchmarks aren't pure or non-opinionated so there's that as well. So far I like Rust quite a lot but -- as I said in another sibling comment -- its procedural style and syntax aren't stellar, in my eyes at least.

since simd intrinsics got introduced there shouldn't be any reason for rust to get 'stomped'

Re: Clang Format Tanks Performance

#110
post #94

Earlier quoted context omitted.

Rust is slower than C++?

Yes, at best 20% slower but can be far more slower if you hit worst case scenario.

"at best 20%" slower is a clearly non factual statement.

Probably the one scenario where it would be far more slower than that would be a heavily AVX-512 intrinsics program because Rust doesn't have those yet (I think), but then that isn't really either language anymore. its intrinsics.

Post reply on HN