5 ms·
Zig doesn’t seem to have an implementation for the TechEmpower Benchmarks but Nim does: https://www.techempower.com/benchmarks/#section=data-r21&l=yxbjen-6bj ht
by rbjorklin 3y ago
Zig doesn’t seem to have an implementation for the TechEmpower Benchmarks but Nim does: https://www.techempower.com/benchmarks/#section=data-r21&l=yxbjen-6bj https://www.techempower.com/benchmarks/#section=data-r21&l=y...
- michaelsbradley 3y agoNim's should probably be redone with mummy (multi-threaded) and chronos (async single-threaded) for a better showing: https://github.com/guzba/mummy https://github.com/guzba/mummy https://github.com/status-im/nim-chronos https://github.com/status-im/nim-chronos
- e4m2 3y agoWhy does the stdlib implementation do so badly in the first place?
- throwbadubadu 3y agoIt is maybe the most simple web server implementation, similar to what you get from "python3 -m http.server"? What sense does it make to compare highly focused web server frameworks to languages most simple stdlib implementations, much apples vs oranges.. (thus also not getting why the proposal to compare with actual web frameworks for nim is that much downvoted?!)
- arc619 3y agoToo much string copying iirc. It was written a while ago. Hopefully it'll get updated/replaced some time, but there's plenty of faster 3rd party ones already.
- fastball 3y agoAnd I'm surprised by how terribly it ranks – basically dead last against everything, even the Python frameworks, which is impressive.
- jackmott42 3y agoIt isn't really a language community so interested in web server efficiency, and until recent years threading efficiently was kind of tricky with the GC scheme they used. If someone wanted Nim to rank high you could do it, but I'm not sure it is worth the effort?
- michaelsbradley 3y agoPossibly it wasn't compiled with `-d:release`. I only looked briefly — is there a way to see the source code and cli flags used for the various implementations?
- Jtsummers 3y agohttps://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Nim/nim-stdlib/nim-stdlib.dockerfile https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast... That appears to be the docker file they used, it's compiled with -d:release.
- janAkali 3y agoNim's default json library is terrible in performance, but there're much faster drop-in replacements like jsony[1]. I'm not sure that's the main issue for low rank, but it's definitely one of them. 1. https://github.com/treeform/jsony https://github.com/treeform/jsony
- treeform 3y agoI would not call std/json it "terrible in performance" probably still way faster then what you get in many other languages (like python). But yes the JSON lib I wrote is faster due to avoiding branches and allocations.
- cmdlineluser 3y agohttpbeast[1] reached #6 at one point, but I think the author is busy with other things nowadays. https://www.techempower.com/benchmarks/#section=data-r18&hw=ph&test=json https://www.techempower.com/benchmarks/#section=data-r18&hw=... [1] https://github.com/dom96/httpbeast https://github.com/dom96/httpbeast
- deleted 3y ago[deleted]