I am using Python's requests library to get a huge JSON response.
Normally, when I do data = resp.json() it takes around 5 seconds.
Then I tried ujson as data = ujson.loads(resp.text), which took around 2 seconds.
Is there a way in which I can get a generator-like object from response? I know we have the streaming facility available, but I guess that will give me data in chunks, whereas I need data as per element as I may then iterate it over for loop.
And while all this is to reduce the time further, is the above method even possible? Or is there any other way in which this can be achieved (I am open to any other library as well)?
Thank you!