-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
json decode is slower than go! #12833
Comments
What about using |
use -d:danger it also slow.... mynumber:3000000.0 bench: 1390.666666666667 ns/op and .... My program requires high JSON parsingWhy is compiling to Clang much slower than go?? |
Dunno, probably you measure different things. |
use packedjsonnumber:3000000.0 bench: 947.6666666666666 ns/op and .... Faster than Java, but seven times slower than golang |
It's not surprising Go's implementation is faster, they deserialize directly into the struct One problem is that Go's implementation is also full of stuff where I can trigger pathological behaviour, you can't just "write a fast JSON library". what if the JSON has a 10GB string literal inside? what if it has object fields with 1000 entries? JSON is used for everything and so you need to protect against so many different things and then once you did, it's kinda slow for the general case. Having said that, we'll of course improve the performance further. |
If it's fast, it's a great programming language |
This comment has been minimized.
This comment has been minimized.
Jason doesn't deserialize (yet). |
Faster than Java, but seven times slower than golang
Nim Code
golang Code
Current Output
nim output
go output
Expected Output
Possible Solution
JSON standard library optimizes performance
The text was updated successfully, but these errors were encountered: