Earlier quoted context omitted.
Because the idea of Xi is that it can support different frontends for different platforms, and that probably wouldn't work out to well if they all had to be in C.
The Xi backend is already written in Rust, a relatively low-level language with a somewhat C-like FFI/ABI. The choice to use JSON in time-critical code, when more performant alternatives are available, seems to me like a mistake.
Simdjson – Parsing Gigabytes of JSON per Second
131–140 of 202 posts
Re: Simdjson – Parsing Gigabytes of JSON per Second
#132Re: Simdjson – Parsing Gigabytes of JSON per Second
#133Perhaps I'm misunderstanding or don't have a good enough grasp of this, but, in what circumstance would you need to parse gigabytes? I've only seen it be used in config files, so...
Or, perhaps a more common scenario today, it was designed by people who simply had no knowledge of binary protocols or efficiency at all --- not too long ago I had to deal with an API which returned a binary file, but instead of simply sending the bytes directly, it decided to send a JSON object containing one array, whose elements were strings, and each string was... a hex digit. Instead of sending "Hello world" it would send '{"data":["4","8"," ","6","5"," ","6","C"," " ... '
Re: Simdjson – Parsing Gigabytes of JSON per Second
#134Perhaps I'm misunderstanding or don't have a good enough grasp of this, but, in what circumstance would you need to parse gigabytes? I've only seen it be used in config files, so...
Re: Simdjson – Parsing Gigabytes of JSON per Second
#135Earlier quoted context omitted.
From “Design Decisions”[1]: > JSON. The protocol for front-end / back-end communication, as well as between the back-end and plug-ins, is based on simple JSON messages. I considered binary formats, but the actual improvement in performance would be completely in the noise. Using JSON considerably lowers friction for developing plug-ins, as it’s available out of the box for most modern languages, and there are plenty…
So is it too slow or not?
Given equally-high quality JSON and binary serdes, JSON is sufficiently fast. Raphlinus is saying that Swift's built-in deserialiser is obnoxiously slow.
Re: Simdjson – Parsing Gigabytes of JSON per Second
#136Firebase backups are huge JSON files and we haven’t found a good way to deal with them.
There are some “streaming JSON parsers” that we have wrestled with but they are buggy.
Re: Simdjson – Parsing Gigabytes of JSON per Second
#137This is very cool. Meanwhile, in the xi-editor project, we're struggling with the fact that Swift JSON parsing is very slow. My benchmarking clocked in at 0.00089GB/s for Swift 4, and things don't seem to have improved much with Swift 5. I'm encouraging people on that issue to do a blog post. [1]: https://github.com/xi-editor/xi-mac/issues/102
Re: Simdjson – Parsing Gigabytes of JSON per Second
#138It's a hammer on rocket fuel.
Re: Simdjson – Parsing Gigabytes of JSON per Second
#139Earlier quoted context omitted.
From “Design Decisions”[1]: > JSON. The protocol for front-end / back-end communication, as well as between the back-end and plug-ins, is based on simple JSON messages. I considered binary formats, but the actual improvement in performance would be completely in the noise. Using JSON considerably lowers friction for developing plug-ins, as it’s available out of the box for most modern languages, and there are plenty…
So is it too slow or not?
Re: Simdjson – Parsing Gigabytes of JSON per Second
#140One of the two authors here. Happy to answer questions. The intent was to open things but not publicize them at this stage but Hacker News seems to find stuff. Wouldn't surprise me if plenty of folks follow Daniel Lemire on Github as his stuff is always interesting.