Skip to content

\uXXXX ? #28

@eltomjan

Description

@eltomjan

Nice parser, would tell there are missing unicode escape chars - my test file generated by browser had'em (see bellow).
And in case U R interested in speed and memory improvements, maybe it would be better to replace StringBuilders by some string "pointer" class - my small test with 1/4TB JSON used 15,68% less memory and 9,4% less CPU.
But best should be to use single string and then only some pointers to that one, but it will probably need more changes in concept, so not sure if it worth (did not changed all _ unused options in my case)...
eltomjan@95ce352

var esc = "{"";
for(var i=8;i<128;i++) esc += String.fromCharCode(i);
esc += ""}";
var js = JSON.stringify(esc);
Result:
{"\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions