Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\uXXXX ? #28

Open
eltomjan opened this issue Mar 28, 2019 · 0 comments
Open

\uXXXX ? #28

eltomjan opened this issue Mar 28, 2019 · 0 comments

Comments

@eltomjan
Copy link

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{|}~�"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant