Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/multipart-collect-linear.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"effect": patch
---

Add `Channel.mkUint8Array` and reuse it from `Stream` and multipart file collection, keeping streamed byte concatenation linear across upstream pulls.
Add `Channel.mkUint8Array` and reuse it from `Stream` and multipart file collection. This also fixes quadratic buffering in `File.contentEffect`, improving collection of a 16 MiB chunked upload by approximately 90x.
10 changes: 10 additions & 0 deletions packages/effect/src/Stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10854,6 +10854,11 @@ export const mkString = <E, R>(self: Stream<string, E, R>): Effect.Effect<string
* await Effect.runPromise(program) // => [1, 2, 3, 4]
* ```
*
* **Gotchas**
*
* This materializes the full content in memory. The source stream must not
* reuse or mutate emitted buffers, which are retained until collection completes.
*
* @category destructors
* @since 4.0.0
*/
Expand All @@ -10877,6 +10882,11 @@ export const mkArrayBuffer = <E, R>(self: Stream<Uint8Array, E, R>): Effect.Effe
* await Effect.runPromise(program)
* ```
*
* **Gotchas**
*
* This materializes the full content in memory. The source stream must not
* reuse or mutate emitted buffers, which are retained until collection completes.
*
* @category destructors
* @since 4.0.0
*/
Expand Down
Loading