Actix (Rust) vs Zap (Zig) vs Zig: Performance (Latency - Throughput - Saturation - Availability)

preview_player
Показать описание


▬▬▬▬▬ Experience & Location 💼 ▬▬▬▬▬
► I’m a Senior Software Engineer at Juniper Networks (13+ years of experience)
► Located in San Francisco Bay Area, CA (US citizen)

▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬

▬▬▬▬▬▬▬ Timestamps ⏰ ▬▬▬▬▬▬▬
0:00 Intro
0:51 Actix (Rust) Overview
1:09 Zap (Zig) Overview
2:17 Pure Zig Overview
2:54 Test

▬▬▬▬▬▬▬ Source Code 📚 ▬▬▬▬▬▬▬

#rust #zig #zap
Рекомендации по теме
Комментарии
Автор

Honestly the fact that you took feedback and went back to make further comparisons that incorporated the feedback from different communities may make it it one of the best videos of this kind around.

BosonCollider
Автор

Thank you for correcting your mistake by rerunning the tests with optimisations! Mistakes are completely normal, but seeing corrections is surprisingly rare...

vercolit
Автор

Note on the previous benchmark: Zig was in 'debug' mode, which is the default, and I didn’t know that. I found a "production-ready" Dockerfile and thought it was properly compiled, so I’m not the only one who made that mistake.

AntonPutra
Автор

How fucking good that not even 1.0 zig took the C library and ran it like a fucking champ. Zig has great future ahead

rasvatissi
Автор

FYI: Zap pre-allocates memory during startup, expecting higher loads… so memory tests don’t mean much.

bowildmusic
Автор

Its really cool to see this sort of "live"/iterative benchmarking developments with feedback. When you feel like it's all as good as it can get, I think it would be really cool to see a blog post with everything you learned, mistakes and all, all in one place!

_Aarius_
Автор

It's interesting that, from an ideological/approach perspective, it seems like toward the upper bound of performance limits, Actix is interested in conserving device resources, while Zap ensures nearly 0 request failures

jm-alan
Автор

150k with 2 cores that is a lot!
i did some similar tests, but on my local machine with NestJs and Go Fibber, not even close:
- NestJs 400 req/s
- Go Fibber around 10k

dam, rust is fast.
i am wondering if there is anything faster than Rust, like a server is C or C++

ionutale
Автор

Schrodinger's Zig:
1. Advertises the speed and security of the language.
2. Requires disabling all runtime security checks to actually reach the advertised speed.

bogdanpanchuk
Автор

This guy efforts deserve like and subs, keep it up! 🤝

dimitriv.
Автор

I'd like to see a comparison between the same web app on Rust Actix-Web and Elixir Phoenix. It might look like apples and oranges but it'll be interesting to see the memory utilization of the two apps. Elixir "processes" are light threads. Actix implements its own light threads but I understand those still use more memory than Elixir (BEAM) processes

cruzfarfan
Автор

I was thinking of running this benchmark on a standalone VM, and I even have everything ready, including the systemctl service files. However, the problem is that when you run something without limits, it starts to affect all other services on that VM. For example, I use node-exporter to collect basic metrics, so without limits, those exporters and agents begin to degrade as well, causing gaps in your monitoring system. You can set cgroup limits using systemctl, but it would be similar to how Kubernetes handles it.

AntonPutra
Автор

I really appreciate these videos. Thanks for putting in the effort to make them and thanks everyone who submits PRs.

Galakyllz
Автор

I would like to see this compiled with Zig safe considering that is the biggest selling point of rust is memory safety.

aquilafasciata
Автор

What was the request output? Could you make it more "real world". Like an json response of 1kb, 10kb, 100kb. And then another test that compiles some zig to html or rust to html (using thr same 1kb, 10kb, and 100kb html outputs). Could you also add golang to these ?

Matty
Автор

Thanks for running and sharing test results!

markchekhanovskiy
Автор

Arguing who's linux syscall wrapper is faster is kinda funny thing to see.

torcher
Автор

Would love to see more golang stuff! Thanks for all the content anyway :)

asezen
Автор

Hi @AntonPutra

I've been following your channel for a while now and I absolutely love your content on comparing tests and benchmarks of different programming languages and frameworks.

I was wondering if you could consider doing a similar comparison between in-memory databases like Redis and RabbitMQ. I'm particularly interested in seeing how they perform under various workloads and use cases.

Thanks for all the great content!

AB.
Автор

100k req/s - like a few small towns clicking in app at the same time

damiankaczmarczyk