It was a pretty no brainer just a few months ago, use actix. But now after what happened with that project not sure. Still seems the fastest with most dependencies for db, redid, logging etc
That's odd. When I first started looking at Rust and looking for a web framework for Rust I came to totally the opposite conclusion.
At the time the Actix developer was threatening to not only quit development but to delete repo. There had been some terrible discussion about their use of "unsafe" in the Actix code.
Given that mess it looked as if Actix was in a perilous condition, development could not be relied on into the future and hence Actix was immediately discounted as an option.
When was that? A year or so later I understand the Actix project is in good hands and development continues.
Meanwhile we have been using Rocket. It has worked out really well. Just now I'm looking into upgrading to Rocket 0.5 with it's async support, looking good so far.
As far as I can tell they are on a par feature wise, at least Rocket is not missing anything we need.
I've used both Rocket and Actix for projects, and I'm also confused, most of the drama around Actix happened over a year ago, and by all accounts it's in a much better place now.
Actually I am in an odd situation right now. I have to choose the web framework for a major business project until end of week, I delayed this choice as much as I can. It must work with Tokio >= 1.0 to play nice with all the business code already implemented...
- Actix-Web seems to only do prerelease-versions for months, v3 does not work with Tokio 1.0, v4 is WiP for months now, and the docs/tests story looks still unfinished.
- Rocket v0.5 is an RC version... looks good and docs... are quite polished. But I have not the slightest clue how the runtime performance will be like when in production (since older versions were far slower than Actix)
Tough choice. Dev-Ergonomics look really similar, with Actix being very fast but not-as-polished on the road to v4, and rocket looking like the thing I really would like to pick, but has currently unknown performance characteristics, at least I couldn't find a comparison how it stacks up against Actix v4.
And ironically: the project does totally require the best possible performance I can get with reasonable work invest, since the "performance gains" will be "invested" in a transition from current REST designs to a flexible GraphQL API, increasing business value in our case quite a bit.
Guess I will wait until Friday evening in the hope that either one framework will come to terms with something like a "stable" release.
@Anonyfox I know several people who have used hyper directly for similar purposes. It requires a bit of work to set it up, but it's surprisingly usable once you get it set up. Depending on the details of your application, this might be a reasonable choice. You would be able to get help with doing this on the Tokio discord.
Between now and Friday evening you have time to set up some simple benchmark(s) of Rocket 0.5 vs Actix 0.whatever. Tailored to your expected use case.
Give that you "have" to do this by then I presume it's OK if you dedicate 100% of you time to it.
My guess, or should I say "hope" is that Rocket 0.5, with its support for async, will be much better performing for connection intensive work loads. We are kind of betting the farm on it ourselves.
We would all be interested in your results.
Well of course I had to look around to see if anyone had already done such benchmarking. Of course they have. Quite comprehensively: Benchmarking vol. 2: Pitting Actix against Rocket v0.4 and v0.5-dev – Matěj Laitl a.k.a. strohel – Technical Blog Interesting reading.
The various graphs there seem to show Actix is always a bit ahead. However the authors conclusion is:
The main takeaway is probably that both prominent Rust web frameworks are fast enough that you can stop caring about performance, and concentrate on other aspects. The endpoint handler tested here is trivial: the more complex your handler is, the less framework overhead matters.
Looks like we will be staying with Rocket.
Thank you very much! Yes, this looks promising and I'll probably go with rocket. Enough time to actually implement some use cases and measure the performance with concrete workloads.
If the conclusion holds, performance differences should be negligible between the two, which would be ideal. More importantly, rocket v0.5 looks way more stable than the current Actix v4 development, at least right now.
Again, thank you!
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.