rust-web-framework-comparison icon indicating copy to clipboard operation
rust-web-framework-comparison copied to clipboard

Add performance benchmark

Open pickfire opened this issue 6 years ago • 9 comments

Benchmarks can be easily done with the examples that they included in the project source itself.

For most of the frameworks, we could just use (except a few weird crates that name it differently such as hello_world or hello):

git clone git_url
cd git_url
cargo run --example hello-world --release

And then on another terminal:

wrk http://localhost:3000

If we could, we could bump each repository and let them have a standard name hello-world with a standard port to simplifies things in the future. What I learned from benchmarking ~7 different frameworks? I am surprised that actix_web was the fastest even when lower level frameworks (hyper, tokio-tinyhttp, tokio-minihttp) is included and does not have routing.

By the way, it would be great if this was included in http://arewewebyet.org

pickfire avatar May 28 '18 16:05 pickfire

Feel free to create a script that runs & records the benchmarks :)

flosse avatar May 29 '18 19:05 flosse

1 example: 245k req/s for actix-web vs 208k req/s for thruster https://www.reddit.com/r/rust/comments/8t18b2/thruster_044_greatly_improved_performance/e146foq/

naturallymitchell avatar Jun 23 '18 20:06 naturallymitchell

@mitchtbaum Please, notice that it was the other way around on my laptop: 245k req/s for Thruster vs 208k req/s for Actix-web, but I cannot believe the numbers as Python-based framework Vibora reaches 328k req/s which is complete nonsense! I don't understand what is going on...

frol avatar Jun 24 '18 07:06 frol

@frol Well, python also has japroto which cloud be a lot faster than Vibora since most parts are written in C.

pickfire avatar Jun 24 '18 15:06 pickfire

@pickfire @frol @naturallymitchell I'm doing the same thing (mesuring performance) in https://github.com/the-benchmarker/web-frameworks

We could centralize our efforts :heart:

waghanza avatar Jan 08 '20 17:01 waghanza

@waghanza There is also https://github.com/TechEmpower/FrameworkBenchmarks which may contains even more

pickfire avatar Jan 09 '20 17:01 pickfire

Sure, but a little bit different. In short, my value is to take care of having up-to-date versions of frameworks and languages

waghanza avatar Jan 10 '20 16:01 waghanza

We could centralize our efforts heart

:+1:

flosse avatar Jan 10 '20 16:01 flosse

There is also https://github.com/rousan/rust-web-frameworks-benchmark

azzamsa avatar May 07 '21 03:05 azzamsa