In a world of APIs, it seems many Python apps spend more time decoding JSON than anything else.
It seems that all JSON decoders however lock the GIL while decoding, meaning it is not possible to speed up JSON decoding using multi-threading, or in general any other means. Multi-processing might work for some use cases where the decoded json does not need to be directly aggregated (e.g. each process might decode and summarize or otherwise process before returning a much smaller result).
I was curious if there is any technical reason a thread-safe JSON decoder could not be written that either decodes JSON across multiple cores internally, or somehow releases the GIL allowing multiple calls in to be made.
If a decoder is basically just creating new objects that cannot be referenced by anything outside of the decoded object tree (yet), is the GIL necessary? What other parts of the interpreter need to be accessed in a way that would require the GIL? Is it things like shared string pools? Are these issues all insurmountable for this specific use case?