Hacker News new | ask | show | jobs
by jason_oster 2945 days ago
I evaluated a few different Rust web frameworks, where performance was the deciding factor. A minimum viable echo server was put through its paces with `h2load` on a relatively recent MacBook Pro. `actix-web` was literally 100x faster than the next fastest competing framework.

The benchmark result really confused me. But you'll find that the `actix` actors are extraordinarily lightweight and highly optimized around the equally lightweight and highly optimized Futures. The design is hard to beat, from a performance standpoint.

1 comments

Have you tried to create a more complex web page and have the web frameworks render that as well? Sometimes being the fastest at the most trivial request isn't enough, if it can't handle complex request fast as well.

Also, do you have a list of speeds for the frameworks you've tested?

A lot of Rust frameworks use sync io. The first generation does because the libraries for async didn't exist yet, and Rocket doesn't because (last I heard), the author said that he didn't feel the ergonomics were there yet, and that's one of Rocket's primary goals. So that leaves Actix, Gotham, and Shio, basically. Gotham hasn't been tuned for performance at all. I haven't seen any Shio benchmarks.

There are a lot though: https://github.com/flosse/rust-web-framework-comparison#serv...

From repo activity Shio seems dead. And here is for gotham https://gotham.rs/blog/2018/05/31/the-state-of-gotham.html
Yeah, that Gotham news happened after I made this comment. Good to know!