News for hackers. Stuff that matters.
Re:Simdjson 0.3: Faster JSON parser by eska on Wednesday April 01, 2020 @08:42AM (#22747973)
They're using those \0 to find bit patterns with SIMD instructions. Their approach would fundamentally not work if they were unable to modify the input.
Re:Simdjson 0.3: Faster JSON parser by dr_zoidberg on Wednesday April 01, 2020 @10:59AM (#22749297)
I'm going a bit meta here:

I absolutely love that the first comment I see coming into the discussion is someone arrogantly telling (us, not the author) how to do their job, when evidently we're looking at one of the most thought-out, better engineered pieces of software there is in their area (JSON parsing).

What's more, the authors of simdjson show a lot of benchmarks, explain how they got there, they provide their effort in a liberal license, and yet... This peep over here comes to tell us how he thinks that's wrong...

Just got a bit ranty. And sorry eska for taking a bit of your comment for it. You tried to give some sense into this guy.

Edit: at first I thought this was the top comment because of being newer... Nope, it's the top comment alltogether. Followed by another comment about the same time as old of someone telling how great this library is and how they're using it in production with a rust wrapper.

Re:Simdjson 0.3: Faster JSON parser by jkeiser on Wednesday April 01, 2020 @12:41PM (#22750655)
simdjson does not modify the input, fyi. Rather than \0, which isn't really a part of JSON, the SIMD instructions search for whitespace and JSON structure like commas, colons, etc.
Re:Simdjson 0.3: Faster JSON parser by eska on Friday April 03, 2020 @02:55PM (#22772822)
Yeah, sorry I didn't feel like giving some guy who hasn't even read the article a full explanation. However I saw in a presentation on YouTube that these characters are replaced (e.g. ") to then apply SIMD instructions. This implies copies and allocations. But these are necessary, and it would not be possible to achieve this with indices.