This looks really nice! I learned Scala primarily to use the Play Framework which is a fabulous way to build large web applications. This looks spiritually quite similar, but with the advantages of Rust.
Actix: a small, pragmatic, and fast Rust web framework
71–80 of 125 posts
Re: Actix: a small, pragmatic, and fast Rust web framework
#72I 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 t…
Also, do you have a list of speeds for the frameworks you've tested?
Re: Actix: a small, pragmatic, and fast Rust web framework
#73I have just started playing with Actix-web. Rust-Noob as well. The yellow world example compiled to a binary that was ~ 5 MB. As a general case, Actix-web pulls in a lot of dependencies at install, and compile time.Are all of those dependencies really necessary for a hello world scenario? Being a Rust newbie, I thought maybe I was using the wrong tool and started to look at hyper instead..
5MB is nothing compared to what you'd use for a similar project in node or Python or Ruby. Sure, it's not the tiniest it could be, but using tools like strip, not including debug symbols etc it gets pretty damn small. Honestly though, at that point I think size becomes entirely pointless to even mention unless you need to run it in a super constrained environment, which you're probably not when you're using the stand…
- Compile with --release.
- Before distribution, enable LTO and strip the binary.
- If your program is not memory-intensive, use the system allocator (assuming nightly).
- You may be able to use the optimization level s/z in the future as well.
- I didn’t mention this because it doesn’t improve such a small program, but you can also try UPX and other executable compressors if you are working with a much larger application.
[0]https://lifthrasiir.github.io/rustlog/why-is-a-rust-executab...
Re: Actix: a small, pragmatic, and fast Rust web framework
#74Earlier quoted context omitted.
To supplement the other sibling question that I answered: It's a learning experience. Right now, I can't port everything to Rust, because each platform has its advantages. Rust is still missing a lot of libs that exist in NPM and Maven, so it makes it difficult. I've been exploring exposing some functions that exist in Java/Kotlin through gRPC (as everything runs on the same network anyways) until it's available on R…
Could you link to your blog, please? I'd like to read about that when you do end up writing about the experience.
[0] http://nevi.me
Re: Actix: a small, pragmatic, and fast Rust web framework
#75I 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 t…
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?
There are a lot though: https://github.com/flosse/rust-web-framework-comparison#serv...
Re: Actix: a small, pragmatic, and fast Rust web framework
#76Earlier quoted context omitted.
5MB is nothing compared to what you'd use for a similar project in node or Python or Ruby. Sure, it's not the tiniest it could be, but using tools like strip, not including debug symbols etc it gets pretty damn small. Honestly though, at that point I think size becomes entirely pointless to even mention unless you need to run it in a super constrained environment, which you're probably not when you're using the stand…
There's a lot that can be done to shrink a Rust binary[0]. A copy of the summary: - Compile with --release. - Before distribution, enable LTO and strip the binary. - If your program is not memory-intensive, use the system allocator (assuming nightly). - You may be able to use the optimization level s/z in the future as well. - I didn’t mention this because it doesn’t improve such a small program, but you can also try…
So, two releases :)
Re: Actix: a small, pragmatic, and fast Rust web framework
#77This looks really nice! I learned Scala primarily to use the Play Framework which is a fabulous way to build large web applications. This looks spiritually quite similar, but with the advantages of Rust.
[1]: http://akka.io/ Akka is the implementation of the Actor Model on the JVM.
Re: Actix: a small, pragmatic, and fast Rust web framework
#78(I might add that this is a question I've had for a while, and I did not check the source at [2] in detail today.)
[1]: https://www.techempower.com/benchmarks/
[2]: https://github.com/TechEmpower/FrameworkBenchmarks/tree/mast...
Re: Actix: a small, pragmatic, and fast Rust web framework
#79Earlier quoted context omitted.
Yes, I'm not constrained in any way to not be able to run a 5 MB binary. I was curious if that was an indication of what is to come for large projects... I guess I was tangentially pointing to complexity and abstraction there.
rust doesn't use dynamic linking, which contributes a lot to that size.
Re: Actix: a small, pragmatic, and fast Rust web framework
#80Earlier quoted context omitted.
Could you link to your blog, please? I'd like to read about that when you do end up writing about the experience.
I assume its [0] as can be found in his profile. Too bad it is throwing an error right now. [0] http://nevi.me