4 ms·
On another note, I see Scala is doing really poorly in the JSON benchmark test: https://github.com/kostya/benchmarks#json https://github.com/kostya/benchmarks#j
by sgt 11y ago
On another note, I see Scala is doing really poorly in the JSON benchmark test: https://github.com/kostya/benchmarks#json https://github.com/kostya/benchmarks#json
- waxjar 11y agoThose aren't very fair to the dynamic languages and JIT compiled languages (this includes Scala). * For the dynamic languages execution time includes the time it takes to lex, parse and interpret the source code. * For language implementations with a JIT execution time includes the time the JIT takes to properly optimise hot code paths. Generally you start benchmarking after a warm up period in such cases. The only fair comparisons are those between ahead of time compiled languages.
- deleted 11y ago[deleted]
- valarauca1 11y agoThe benchmark suited used the STDLIB json parser which is slow as hell. How slow is it? In 2011 there was a proposal to deprecate it, which never happened [1]. Why? STDLIB parser loads the file line-by-line, then copies line by line into a new buffer that joins the strings together. Then the parser is called. The Scala community normally circumvents by using non-standard community developed solutions. Furthermore JIT vs Compiled language benchmarks are pretty unfair to JIT'd languages. Especially for the JVM which doesn't start to compile sections until >10,000 calls. [1] https://groups.google.com/forum/m/#!msg/scala-user/P7-8PEUUj6A/NonA0_IIovsJ https://groups.google.com/forum/m/#!msg/scala-user/P7-8PEUUj...
- jinst8gmi 11y agoWell that makes the result pretty much irrelevant as nobody actually uses that lib for any serious JSON parsing.
- kal31dic 11y agoSo which is the go to library for serious parsing in Scala? And how would you change the benchmark to make it fair ?
- justthistime_ 11y agoI'd use Jackson.
- zackangelo 11y agoNo one uses the built-in Scala JSON parser. Checkout jawn[0] or spray-json[1]. [0] https://github.com/non/jawn https://github.com/non/jawn [1] https://github.com/spray/spray-json https://github.com/spray/spray-json