Hacker News new | past | comments | ask | show | 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:


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 | Lists | API | Security | Legal | Apply to YC | Contact