go-json
go-json copied to clipboard
High CPU usage when decode json string contains numerous '\'
When json string contains numerous '\' (eg: Windows file path), "decoder.decodeEscapeString" will do too many memory move works.
This is my pprof graph:
And I think the problem is here
I have meet the same problem.
Also seeing a difference in parsing large JSON blobs with escaped JSON embedded within a string value but only whilst using the Decoder
.
As soon as I remove the nested escaped JSON the Decoder
performance is much closer to Unmarshal
.