4 ms·
Parsing JSON is synchronous, but fetch itself doesn’t read the body data. > [1] to parse the body as JSON, first the body data has to be read from the incoming
by pininja 5y ago
Parsing JSON is synchronous, but fetch itself doesn’t read the body data.
> [1] to parse the body as JSON, first the body data has to be read from the incoming stream. And, since reading from the TCP stream is asynchronous, the .json() operation ends up asynchronous.
[1] https://stackoverflow.com/a/59555579 https://stackoverflow.com/a/59555579
- mcintyre1994 5y agoIs that basically the same point at a lower level though? I don't think reading the stream involves a round trip?