3 ms·
That json test gets a lot of attention but A) large scale floating point IO is a terrible application of json (if for no other reason than that float parsing is
by cb321 6y ago
That json test gets a lot of attention but A) large scale floating point IO is a terrible application of json (if for no other reason than that float parsing is slow) and B) this mostly measures construction of a big object graph, not json parsing, and so is a poorly isolated test.
A better Nim impl would use `parsejson` directly at which point its speed can approach the fastest of any impl. [1] Also, it is implementions (like stdlib) that are assessed not the speed of the language. There are like 10 json parsers beyond the stdlib. No idea about Crystal ecosystem diversity...
EDIT: Also, I just ran the base64 encode/decode and with `crystal build --release b64.cr` vs. `nim c --gc:markAndSweep -d:danger --cc:gcc --passC:-flto b64`, the Nim ran twice as fast not half as fast.
Anyway, people should not draw conclusions like "Crystal is faster than Nim" from things like this.
[1] https://forum.nim-lang.org/t/6920 https://forum.nim-lang.org/t/6920