logoalt Hacker News

fwipyesterday at 4:38 PM1 replyview on HN

I agree with your post, but in practice, couldn't you get back that efficiency by setting T = UInt8Array? That is, write your stream to send / receive arrays.

My reference point is from a noob experience with Golang - where I was losing a bunch of efficiency to channel overhead from sending millions of small items. Sending batches of ~1000 instead cut that down to a negligible amount. It is a little less ergonomic to work with (adding a nesting level to your loop).


Replies

paulddrapertoday at 2:04 AM

Yes, then you are back to Cloudflare's suggested interface.

An async iterator of buffers.