3 ms·
I just tried it out and it's very slow. Using `wrk` to hit a basic endpoint that just prints "hello", I got ~500 req/sec. Using a third party zig implementation
by latch 3y ago
I just tried it out and it's very slow. Using `wrk` to hit a basic endpoint that just prints "hello", I got ~500 req/sec. Using a third party zig implementation, I got ~175000 req/sec.
It's also both cumbersome to setup and use.
Before learning Zig, I used to think Zig needed an http server in the standard library. After using it for a few months, and watching this implementation get added, I think it's a mistake - there just isn't enough bandwidth to support a _quality_ kitchen-sink included stdlib.
- synergy20 3y agomight add this as a performance issue to zig's github ticketing system? before 1.0 there is always room to improve it
- cturtle 3y agoMaybe you compiled in Debug rather than a Release mode? There is also definitely enough time before Zig reaches 1.0 to improve things.
- fbdab103 3y agoI do not think fast needs to be a goal? Great to have sure, but a slow, stable, compliant implementation is perfectly fit for purpose in the standard library.
- KRAKRISMOTT 3y agoIf you are getting 500 reqs per second for a statically typed compiled systems programming language with no garbage collector on a modern machine, you have bigger problems than standards compliance. 1Ghz/500 is ~2Mhz per request. Taking 2 million cycles to respond to a request in a benchmarked environment on localhost means something has gone horribly wrong.
- karmakaze 3y agoOne of the things that made Go good is that the stdlib may not have everything, but what it has was production grade in terms of performance. I don't see value in spreading work out thin just to have something in the stdlib.