I just want to announce that I have taken some time to implement a JSONEncoder and JSONDecoder in pure Swift. That means neither did I use any third party libraries nor did I use Foundation. Further I didn't use any unsafe syntax at all. The encoding and decoding is about 1.5-2x faster on macOS and 8-10x faster on Linux.
Not using Foundation comes with some drawbacks though. For example: I can't provide custom encoders for Data and Date as the Foundation implementation does provide.
I'm sure there are still some performance bottlenecks in the code (especially encoding I guess) and I'd be grateful to get some feedback.
Of course this implementation doesn't reach the speed of any simd implementation. But SIMD instructions are now part of the Swift STL. So this might be something worth looking into. Sadly I have no idea how to implement the approach presented by Daniel Lemire with the given Swift simd instructions. If you can point me in the right direction, please reach out.