DevotionGeo

DevotionGeo

What is the reason behind Rust’s web framework, Rocket, not performing as well as expected in the Techempower benchmarks?

I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a lot better, even in these benchmarks.

Techempower: All of the fullstack frameworks with full ORM

Most Liked

OvermindDL1

OvermindDL1

I don’t trust techempower first of all, far too many libraries doing questionable things that would never ever be done in production in it.

Second of all, last I checked the rocket.rs code it’s using is forcing each request to come as a new tcp connection, which will significantly make it ‘look’ slower than most other libraries (the fact its even still as fast as it is, is quite impressive though). To simulate more ‘actual’ web usage all testing should be done with new tcp connections each time though.

Third, the rocket.rs version they are using is still using the old version of hyper pre-async, which though still fast is not anywhere near as fast as modern hyper (which is used by the nightly version of rocket, which is the one most people use of rocket anyway until the next big release).

That’s what so so many of the libraries in the benchmarks do though, they aren’t even remotely oriented for what would seem like real world use, optimized only for benchmarks.

Qqwy

Qqwy

Great question!

Part of the answer might be this GitHub comment by Rocket’s primary maintainer, especially the second item:

There are three reasons: [why Rocket was not part of the Techempower benchmarks at the time]

  1. I personally believe that developers tend to misplace trust on benchmarks. As such, it might be a good thing that Rocket isn’t on there. Perhaps then the decision of which framework to choose can be based on what’s really important: ergonomics, productivity, security, and correctness.
  2. Rocket doesn’t and won’t ever cater to benchmarks. That is, we won’t make design decisions or changes to Rocket just to be faster at a particular benchmark without further justification.
  3. No one’s written/submitted to TechEmpower.

Of course, it would still be interesting to see what is happening here that makes Rocket less efficient for these particular microbenchmarks w.r.t. other frameworks, especially the other frameworks also written in Rust.

dimitarvp

dimitarvp

It’s a social problem, not technical, so not sure a random bunch of a few enthusiasts can help much. Maybe if we roll our own benchmarking harness. But that would entail huge technical voluntary work – and we must have people that mercilessly curate the submitted code so that it doesn’t just game the benchmarking metrics.

Where Next?

Popular Backend topics Top

New
New
pillaiindu
I have heard many times that languages with a garbage collector aren’t great for system programming. Today I saw a book titled “Hands-On ...
New
New
First poster: bot
What's so exciting about Postgres? with Craig Kerstiens (The Changelog #417). PostgreSQL aficionado Craig Kerstiens joins Jerod to talk ...
New
First poster: bot
Multicore OCaml: October 2020. Welcome to the October 2020 multicore OCaml report, compiled by @shakthimaan, @kayceesrk and of course my...
New
Jsdr3398
I really need developers to help create my messaging platform but I’m not sure how much they want etc. I’ve never hired anyone before :s...
New
jaeyson
Sorry for the very vague noob question, I really want to ask this: When do we use async or sync code in the context of Elixir? AFAIK gen...
New
KnowledgeIsPower
Do you just use plain Terraform alone? Do you use CDK for Terraform or other supporting tools (e.g. Terraform Cloud ) for Terraform?
New
luigiluigiluigi
Hey everyone! :wave: We’re looking for a Back-End Developer Volunteer to help us build something impactful! If you want to gain real-wor...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
axelson
I’ve been really enjoying obsidian.md: It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New
AstonJ
Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face: https://on...
New
PragmaticBookshelf
“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin Even when you’re ultimately right about what the future ho...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New