Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Framework Benchmarks #710

Closed
hasanOryx opened this issue Jul 17, 2018 · 6 comments
Closed

Web Framework Benchmarks #710

hasanOryx opened this issue Jul 17, 2018 · 6 comments
Labels
duplicate This issue or pull request already exists question A question (converts to discussion)

Comments

@hasanOryx
Copy link

Hello,
Why rocket is not appearing here, how it can benchmarked with other web frameworks, mainly with other rust based frameworks?

@SergioBenitez SergioBenitez added the question A question (converts to discussion) label Jul 17, 2018
@SergioBenitez
Copy link
Member

There are three reasons:

  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.

This is also a duplicate of #296.

@SergioBenitez SergioBenitez added the duplicate This issue or pull request already exists label Jul 17, 2018
@marcbarbosa
Copy link

marcbarbosa commented Aug 15, 2018

@SergioBenitez I totally agree with you about your points to not add Rocket to TechEmpower benchmark. But, I did implemented as a Rust/Rocket learning process.
It would be great if you could check it out and give some advices. Thanks!
TechEmpower/FrameworkBenchmarks#3996

@DevotionGeo
Copy link

Would you guys please have a look at this thread at DevTalk, especially OvermindDL1's comment.

@jebrosen
Copy link
Collaborator

@DevotionGeo

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.

This sounds to me like the change in TechEmpower/FrameworkBenchmarks#5296 to disable keep_alive. The implementation of keep_alive in either hyper 0.10 (the underlying http library), or rocket 0.4, or both, seems to be buggy, but it is not a problem for all benchmarks and deployment setups. I don't know if this change is reflected in the latest TechEmpower results, but I do remember that before that change there was a very high error rate in the benchmark for rocket. I expect the async migration (#1065), coming in rocket 0.5, to fix all of these and several other issues at the connection level because it includes an update to hyper 0.13 - which is mentioned in that thread as well:

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).


Finishing and testing async and other 0.5 work is currently my top priority for Rocket. I am interested updating the benchmark to use rocket 0.5 once released, if nobody beats me to it. At the same time, I plan to make any changes if necessary to ensure that it looks like an "idiomatic" rocket application and doesn't have any undue performance issues stemming from the particular implementation.

@DevotionGeo
Copy link

DevotionGeo commented Jun 22, 2020

@jebrosen
Thank you for the great work you do!

@hanming2033
Copy link

hanming2033 commented Jan 26, 2021

Sorry, understanding whatever that have been discussed here (and I agree). I am still "curious" to know rocket 0.5 performance.
There is an article about this: https://matej.laitl.cz/bench-actix-rocket/.

Besides, I want to know how it fares against other frameworks like NestJs and Spring. So I did some autocannoning on my laptop.
I am just starting to learn Rust and not even at beginner level. So please let me know if I have done something wrong.
hello world example

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question A question (converts to discussion)
Projects
None yet
Development

No branches or pull requests

6 participants