top | item 12233299

(no title)

hyperturtle | 9 years ago

SAX-style / streaming parsers do exist for json. http://oboejs.com/ http://rapidjson.org/md_doc_sax.html

discuss

order

colanderman|9 years ago

JSON has no notion of object "type". So if you have a list of things, whose processing is determined by their type, you may need to parse the entire object before finding the key/value pair that distinguishes its type.

Because XML puts the "type" of an object syntactically first, it supports this use case.

Mikhail_Edoshin|9 years ago

Pity they don't use it for npm, which cannot create a local search index because of this: it tries to load a large JSON file into memory and fails. I never was able to do this on my VM despite trying to give it more memory (up to 2 GB, at which point I gave up).