Increase the default auto alllocate chunk size#6534
Conversation
From 4KB to 64KB. This increases the default chunk size for default reads on internal streams, which should reduce the number of individual reads for larger payloads when piping data or iterating over the stream.
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
This PR increases the default auto-allocate chunk size for byte streams from 4KB to 64KB to reduce read count for larger payloads.
- [HIGH] Ungated behavioral change: The default chunk size for byte-stream default reads is user-observable (it determines the buffer size passed to
pull()viabyobRequest.viewand the chunk sizes returned byreader.read()). Changing from 4KB to 64KB without a compat flag is a breaking change for deployed workers that depend on the old size. The existingnoAutoAllocateChunkSizeflag controls whether the default is applied, not what value it is. This needs its own compat flag or should be gated behind an existing one. - [LOW] Stale comment: The legacy-path comment still says "default to 4096".
This review was generated by an AI assistant and may contain inaccuracies.
|
I'm Bonk, and I've done a quick review of your PR. This PR increases the default auto-allocate chunk size for byte streams from 4KB to 64KB. I posted a review on PR #6534 with the following findings:
|
npaun
left a comment
There was a problem hiding this comment.
Do you have data from local testing, or are we going to have to try it live to see if helps?
|
Up to 80% faster TTLB on a 1 MB payload. |
From 4KB to 64KB. This increases the default chunk size for default reads on internal streams, which should reduce the number of individual reads for larger payloads when piping data or iterating over the stream.