5 ms·
If you read the source code, it’s fair to say that while you can use the frameworks and implementations at the top to build your own systems, they would likely
by lstamour 6y ago
If you read the source code, it’s fair to say that while you can use the frameworks and implementations at the top to build your own systems, they would likely perform slower than these benchmarks as you add more features to them. Now, you might not need to add features, and that’s fair, but then you should compare implementations equally and that’s impossible when not every benchmark is written with identical algorithms and implementation code, for, well, obvious reasons.
It’s worth looking at low level HTTP, socket and concurrency management if you want faster performance, but that’s not really a language-exclusive feature at that point. And the more realistic you make the benchmark — the more communication between microservices, for example - the more your application architecture, deployment hardware, kernel and network tuning, and so on can play a role.
I am reminded of http://rachelbythebay.com/w/2020/10/14/lag/ http://rachelbythebay.com/w/2020/10/14/lag/ for example, as something really low level you probably don’t need to worry about… until you do. http://rachelbythebay.com/w/2020/05/07/serv/ http://rachelbythebay.com/w/2020/05/07/serv/ also. The same is true of most of the performance optimization at the top. Really fast? Yes. Useful? Depends on the rest of your code. Are you writing haproxy? How much does your app really need to do? Read the benchmark source code and get inspired, maybe.
My conclusions for the moment: Switch to Go if low memory usage and high performance is as critical to you as post-1.0 stability. Go is generally stable these days ;-) Otherwise if instability can be tolerated but you want high performance, use one of these newer web server techniques and write a web server in unmanaged C++ that has very minimal functionality with language bindings. Just-js can serve as an example. Heck, the PHP benchmarks show that if you use PHP to write your own HTTP server you can still achieve high performance. That tells me the advantage here goes to web servers that literally “do less” rather than picking a language as faster over another language… especially when most (all?) languages can interface with C or C++ to do the HTTP layer at high performance while writing your code in whatever language you choose…
- AtlasBarfed 6y agoI've noticed Rust frameworks are invading the top ranks in the last couple rounds. Of course there was lots of .. controversy over unsafe in actix. I wonder if the current actix-core is the rewritten/safer one once a bunch of Rusters wrestled/annoyed the original author into handing it over. If so, it's still near the top.
- herbstein 6y agoActix is entirely a community project now, and a big scrutiny has been placed on the few instances of unsafe code that still remain. They should be correct/verified at this point.