Files
ladybird/AK
Andreas Kling a6b9548b93 AK: Switch AllocatingMemoryStream to a singly-linked chunk list
The old implementation stored chunks in a Vector, which meant every
discard() had to call Vector::remove(0, N) to drop the consumed chunks
from the front, shifting every remaining chunk down. For a stream used
as a back-pressure queue, draining it by discarding one chunk at a time
was quadratic in the queued chunk count: in RequestServer that cost
about a second of CPU per large response.

Replace it with a singly-linked list of chunks (head, tail, head read
offset, tail write offset) so push-back and pop-front are both O(1)
and no shifting ever happens. Each chunk now holds its CHUNK_SIZE byte
array inline rather than a separately-allocated ByteBuffer, which also
halves the per-chunk allocations. Teardown unlinks iteratively to avoid
recursive OwnPtr destructors on very long chains.
2026-04-22 13:32:07 +02:00
..
2025-11-20 15:44:25 +01:00
2024-12-04 16:45:58 +00:00
2026-04-16 21:01:28 +02:00
2026-02-17 12:38:51 +00:00
2026-01-29 10:10:12 +01:00
2026-02-17 12:38:51 +00:00
2024-11-19 22:07:01 -07:00
2024-11-10 14:48:20 -07:00
2026-03-20 12:03:36 +01:00
2024-12-28 05:39:32 -08:00
2025-08-23 16:04:36 -06:00
2022-12-03 23:52:23 +00:00
2026-02-18 08:02:45 -05:00
2024-02-11 18:53:00 +01:00
2026-02-17 10:48:09 -05:00