Performance characteristics of HTTP.zig
mainHTTP.zig is a pure Zig port of an HTTP server. When compared to Rust (Actix), it offers significantly lower memory usage and binary size, while maintaining comparable runtime performance.
Key performance observations:
- Memory Usage: HTTP.zig uses approximately 1/3 the memory of Actix (e.g., 2 MB vs 6 MB in release modes).
- Binary Size: HTTP.zig produces much smaller binaries (e.g., 141kb vs 2.5 MB).
- Throughput: Zig can achieve higher peak throughput in certain configurations.
- Latency: Actix generally provides better latency and lower standard deviation (less scatter).
- Dependencies: HTTP.zig is highly lightweight, pulling in only 1 dependency compared to the large dependency tree of Actix.
To achieve the low memory usage noted, specific application-level tweaks in the server configuration may be required to tailor the server to the intended environment.