PERF: fix JSON performance regression from 0.12 (GH5765)