Hacker News new | ask | show | jobs
by fastball 1055 days ago
And I'm surprised by how terribly it ranks – basically dead last against everything, even the Python frameworks, which is impressive.
6 comments

Nim'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

I 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.
Interesting. The Vercel benchmarks make it look pretty good. Only slightly behind rust. https://programming-language-benchmarks.vercel.app/zig-vs-ru... Benchmarks are as much about the skill of the programmer as they are about the language. I suspect those numbers could improve drastically.
You've linked to Zig vs. Rust, which really should be outperforming Rust. The grandparent was talking about how Nim seems to be doing terribly.
httpbeast[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=...

[1] https://github.com/dom96/httpbeast

Sums up most nim libraries unfortunatelly
Possibly 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?
https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast...

That appears to be the docker file they used, it's compiled with -d:release.

For reference, here's some other benchmarks which show happyx (a Nim framework) to come on top: https://web-frameworks-benchmark.netlify.app/result
It 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?