Closed ethercrow closed 3 years ago
This is an impressive improvement! If you don't mind, I'll review it next week. I'm on a vacation right now.
No worries, enjoy your vacation! Jsonifier has already been a big win for me, especially when applied to some float-heavy payloads.
Just so you know, this PR won't affect the performance of "jsonifier", since it uses a specialised version of this algorithm, which also handles escaping.
So Jsonifier.writeJson
should benefit from this PR, right?
Released. Thanks for you contribution and apologies for not coming back earlier.
SSE2 is available on every x86_64 CPU and has a perfect instruction for UTF16->UTF8 ASCII conversion: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=5608,5656,3357,300,3343,5608,3864,3555,4115&techs=SSE2&text=_mm_packus_epi16
Benchmarks before/after (on a pretty noisy machine):