3 ms·
I've tried to parse those test files in Deno (in a very rudimentary test[1]), the results (on my i9-9980HK @ 2.40GHz) are: canada.json --> 31 ms,
by ypcx 6y ago
I've tried to parse those test files in Deno (in a very rudimentary test[1]), the results (on my i9-9980HK @ 2.40GHz) are:
canada.json --> 31 ms, 73 MB/s
citm_catalog.json --> 13 ms, 135 MB/s
code.json --> 17 ms, 113 MB/s
example.json --> 0 ms, 73 MB/s
sample.json --> 6 ms, 124 MB/s
twitter.json --> 6 ms, 114 MB/s
[1] https://gist.github.com/youurayy/18553475c5a9f81a17345cddeebc5d08 https://gist.github.com/youurayy/18553475c5a9f81a17345cddeeb...
- tptacek 6y agoIs that code unmarshalling to types?
- ypcx 6y agoDeno is a JavaScript runtime built in Rust, so I guess it depends what you mean by "types". Definitely not a strong typing, although the example could be rewritten to TypeScript, which Deno supports natively. I use Deno sometimes, so it was of interest to me to compare it to the advancements presented here for Go.
- tptacek 6y agoI like Deno (v8 is written in C++, not Rust, for what it's worth); the question is just: is it doing the same work that the encoding/json benchmark is doing? What are we comparing?
- Matthias247 6y agoYou can see in the linked code that it just calls `const parsed = readJsonSync(fileName)`, which likely returns an untyped struct. So this purely does parsing into an anonymous structure, and not validation and mapping into something strongly typed