How can Rust be so fast in the TechEmpower Web Framework Benchmarks? (kerkour.com)
from snaggen@programming.dev to rust@programming.dev on 11 Apr 2024 21:20
https://programming.dev/post/12658044

#rust

threaded - newest

balder1993@programming.dev on 12 Apr 2024 01:35 next collapse

Benchmarks should be like a scientific paper: they should describe all the choices made and why for the configurations. At least that will show if the people doing it really understand what they’re comparing.

UnfortunateShort@lemmy.world on 12 Apr 2024 01:57 next collapse

Have you ever read a paper? You can consider yourself lucky if they have error bars and repeated their measurements more than once. The quality of “benchmarking papers” is comically bad (on average).

anlumo@feddit.de on 12 Apr 2024 03:31 collapse

What’s the error bar on that statement of yours?

UnfortunateShort@lemmy.world on 13 Apr 2024 12:13 collapse

I don’t know and I won’t pretend it does have any statistical significance. I will just say that I have read dozens of papers and anecdotally, the results were questionable in almost all cases. And not because of the possibility that they might have missed something, but because of basic shortcomings. Some don’t even state how often they repeated their experiments, software versions, whether they accounted for caching effects, (system) temperature, hardware characteristics, you name it.

That’s why I wouldn’t name papers a prime example for clean benchmarking. The quality on YT news outlets like Gamers Nexus or Hardware Unboxed is higher than most of them by far.

FizzyOrange@programming.dev on 13 Apr 2024 09:20 collapse

Yeah I have to second UnfortunateShort. Benchmarking papers are on average very bad, often because they’re trying to push a particular idea or product and are very biased, or because they’re like “my first benchmark” and done by people who don’t know what they’re doing.

A classic one that gets referenced a lot is “Energy Efficiency Across Programming Languages” I which the authors seriously benchmarked programs from the very heavily gamed Computer Language Benchmarks Game, and concluded among other things that JavaScript is much more energy efficient than Typescript.

The only realistic way to benchmark different languages is to take implementations that weren’t written to be fast in a benchmark. For example Rosetta Code, or maybe leetcode.com solutions.

Or to do it yourself. But that requires you to be experienced in many languages.

Difficult for obvious reasons.

bonus_crab@lemmy.world on 13 Apr 2024 05:27 next collapse

so to briefly answer the question in the title after reading the article : i dunno maybe prepared statements

[deleted] on 13 Apr 2024 06:46 next collapse

.

snaggen@programming.dev on 13 Apr 2024 07:09 next collapse

You don’t have to understand everything, it is ok. And joining a language community for a language you hate just to rant about it, shows that you should try to focus on letting things go. It feels a bit obsessive.

If you actually like to have a conversation about the language, I suggest you be a bit more specific and we will try to answer to the best of our ability.

Have a nice day, and don’t forget to breathe.

[deleted] on 13 Apr 2024 08:10 collapse

.

arendjr@programming.dev on 13 Apr 2024 09:07 collapse

Please, please make a blog and spew your tirades there 😂

BB_C@programming.dev on 13 Apr 2024 07:44 next collapse

the shittiest

subjective

slowest

nope


Thank you for participating.

porgamrer@programming.dev on 13 Apr 2024 12:43 collapse

What a whirlwind!

Also, Rust is perhaps, the shittiest, slowest compiled language out there. Even TCC has a leg up on it.

TCC is written exclusively to compile quickly, not to do any real optimisation. There is no conceivable situation in which TCC output will outperform equivalent Rust code.

If you really like how Rust handles its syntax, use a real functional language like OCaml

Rust takes inspiration from OCaml in almost every area except syntax. Close to zero syntax similarly.

In fact, SML compilers like MLton are sometimes faster than Rust.

Lmao, this is a classic line from ~2009 message boards, but with “C++” swapped out for Rust.

Almost every single thing you said is wrong, but in a way too precise to be attributed to random noise. Like scoring zero in a multiple choice exam. I don’t know if you are some kind of performance art troll, but please continue. I’m an instant fan of your work.

Kissaki@programming.dev on 13 Apr 2024 09:04 collapse

I would have expected that at least all the frameworks were using the same database, but no. Some frameworks use MySQL, others use PostgreSQL. Some framework implementations are ultra-optimized and others are what you would expect in your average web application. Some frameworks are using proper templating libraries, others are using Sprintf.