Hacker News new | ask | show | jobs
by explaininjs 1187 days ago
No reason to transfer the image data in JSON, just read the response as an ArrayBuffer. Pass over that and write it into a dataURI with the needed modifications in a single go.
1 comments

How are you going to do that? There's other things in the payload. If it was just the image in the response you could read it as binary, but remember we want lots of tiny images coupled with titles and other metadata. You can use something other than JSON but it'll need some kind of structure that needs parsing.
I don't see how it would ever need to be more than a single pass over the data. Sure the logic might be mildly complicated, but nothing CPU intensive.