News for hackers. Stuff that matters.
Re:Simdjson 0.3: Faster JSON parser by tmikaeld on Wednesday April 01, 2020 @12:35AM (#22745726)
anyone know what the V8 engine uses?
Re:Simdjson 0.3: Faster JSON parser by Leszek on Wednesday April 01, 2020 @01:20AM (#22745941)
V8 has a hand rolled JSON parser which feeds directly into our object model without any intermediate data structures. This allows us to take advantage of structural knowledge, e.g. we assume that objects in an array have the same shape (and just verify this before falling back to pointer chasing through transition trees).

I keep meaning to look into SIMD for both this and ordinary tokenisation, last time I tried it the bookkeeping overheads and alignment requirements weren't worth the speedup but it's always worth re-evaluating.

Re:Simdjson 0.3: Faster JSON parser by lioeters on Wednesday April 01, 2020 @01:58AM (#22746123)
Here's the JSON parser for V8. I'd never looked at it before, but it's surprisingly straight-forward and readable.

https://github.com/v8/v8/blob/master/src/json/json-parser.cc

Re:Simdjson 0.3: Faster JSON parser by fulafel on Wednesday April 01, 2020 @12:51AM (#22745816)
Most JSON parses are small. Does this have bigger spin-up overhead? Also the memory handling requirements of working with GC'd JS data are very particular, this sounds like it has its own way with memory.
Re:Simdjson 0.3: Faster JSON parser by jkeiser on Wednesday April 01, 2020 @12:34PM (#22750576)
simdjson's spinup overhead is minimal, it runs at a pretty steady rate no matter the size of document: https://github.com/simdjson/simdjson/blob/master/doc/growing...

It's also still faster than other parsers in our tests, even on the smallest documents (https://github.com/simdjson/simdjson/issues/312#issuecomment... advantage is just smaller, like 1.1x and 1.2x instead of 2.5x :) It really starts to pull ahead somewhere between 512 bytes and 1K.

Re:Simdjson 0.3: Faster JSON parser by saagarjha on Wednesday April 01, 2020 @01:10AM (#22745897)