Hacker News new | comments | show | ask | jobs | submit login

Note that the dart2js version of the Dart JSON decoder is lazy; if you don't actually read all of the JSON, it won't create the Dart maps corresponding to the JavaScript objects. On the other hand if you do read everything, laziness is no help and may slow things down. (At least, it makes performance measurement more difficult.)

The JsonDecoder class has a reviver argument, same as JavaScript. But the only use I found for it in the protobuf library was to disable laziness:

https://github.com/dart-lang/protobuf/blob/814653b49b90b48db...

Some kind of JsonListener would be welcome when we don't need to create these Dart maps at all.




I should have stated this more clearly in the post - that it is lazy. I referred to the code itself, but did not explain what the code does very clearly, just said that it has a lot of overhead.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: