Question

I have json with some objects in it. And only one object from json i need. So which approach will be better for speed and performance - parse only this object or parse whole document instead?

Was it helpful?

Solution

If you want to show only the particular JSON Object which may be either inside a JSON Object or JSON array itself then you just parse that particular JSON Object instead of parsing whole document.

OTHER TIPS

If you are not going to use rest of the data, you can just parse the item you only need.

In theory, just the object would get you a result faster with lesser work times. So just parse the object you need.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top