grain
grain copied to clipboard
stdlib: Use a streaming optimized parser in json
The current implementation of json makes use of grain's parseFloat
, this has multiple disadvantages namely that we have to prevalidate the input, and build a buffer for parsing numbers instead of parsing them in a streaming manner. this could be optimized by using a custom streaming-optimized parser.
Some notes on how this could be done are here: https://github.com/grain-lang/grain/pull/1133#issuecomment-1383142914