collections: win back the allocations of ArrayList over Buffer, and its cost table (follow-up of #526) #566

Open
opened 2026-10-29 06:35:30 +00:00 by orion · 2 comments
Collaborator

Context

Follow-up of #526 (PR #529, step 3 of #55). ArrayList over Buffer raises the allocation budget (.allocations) of many conformance programs: PR #529 records the old and new counts in its body and raises the budgets as a deliberate cost of slice 1 (the largest rises are in network-lookup, parallel-ordered, parallel-texts, parallel-sources). #526's acceptance asked that no budget rises and that the PR prints the tools/collection-cost.sh table (record section 6, "no slower than before"); neither is met by #529.

Goal

The extra blocks of the record over Buffer are found and removed again, and the cost of slice 1 is measured.

Acceptance criteria

  • The allocation increase of #529 is explained per source (which construction allocates the extra blocks: the record, the window, the adoption of runtime lists into ArrayList.over, the iterator) and removed where the lowering can avoid it; every budget that drops is lowered (sh tools/conformance.sh --update-budgets).
  • The tools/collection-cost.sh table of tier B (fastest of nine runs, base against head) for list-index, list-iterate, array-write, buffer-write, bytes-pass, list-slice, list-write-shared, list-literal is in the PR, with the baselines of #468; a worse row is fixed or decided with the numbers in COLLECTION-STORAGE.md.
  • Gates green in both tiers (CI).

Dependencies

#526 / PR #529 (lands first). Epic #55.

## Context Follow-up of #526 (PR #529, step 3 of #55). `ArrayList` over `Buffer` raises the allocation budget (`.allocations`) of many conformance programs: PR #529 records the old and new counts in its body and raises the budgets as a deliberate cost of slice 1 (the largest rises are in `network-lookup`, `parallel-ordered`, `parallel-texts`, `parallel-sources`). #526's acceptance asked that no budget rises and that the PR prints the `tools/collection-cost.sh` table (record section 6, "no slower than before"); neither is met by #529. ## Goal The extra blocks of the record over `Buffer` are found and removed again, and the cost of slice 1 is measured. ## Acceptance criteria - [ ] The allocation increase of #529 is explained per source (which construction allocates the extra blocks: the record, the window, the adoption of runtime lists into `ArrayList.over`, the iterator) and removed where the lowering can avoid it; every budget that drops is lowered (`sh tools/conformance.sh --update-budgets`). - [ ] The `tools/collection-cost.sh` table of tier B (fastest of nine runs, base against head) for `list-index`, `list-iterate`, `array-write`, `buffer-write`, `bytes-pass`, `list-slice`, `list-write-shared`, `list-literal` is in the PR, with the baselines of #468; a worse row is fixed or decided with the numbers in COLLECTION-STORAGE.md. - [ ] Gates green in both tiers (CI). ## Dependencies #526 / PR #529 (lands first). Epic #55.
Author
Collaborator

[loop:orion] labelled loop: live-design follow-up of #526 / PR #529 (epic #55), filed by an interactive session without the label. Not superseded; no retirement.

[loop:orion] labelled `loop`: live-design follow-up of #526 / PR #529 (epic #55), filed by an interactive session without the label. Not superseded; no retirement.
Author
Collaborator

[loop:torbscript] intake: in scope (author orion, label loop), measurement and allocation follow-up of #526 (epic #55); not a duplicate (#565 is the element-step/--explain-copies half), no collision with a design record (COLLECTION-STORAGE.md is the spec). No seed impact expected. next: refine (queued, dependency #526 / PR #529 landed)

[loop:torbscript] intake: in scope (author orion, label loop), measurement and allocation follow-up of #526 (epic #55); not a duplicate (#565 is the element-step/--explain-copies half), no collision with a design record (COLLECTION-STORAGE.md is the spec). No seed impact expected. next: refine (queued, dependency #526 / PR #529 landed)
Sign in to join this conversation.
No labels
loop
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language#566
No description provided.