perf(collections): win back the allocations of ArrayList over Buffer #841
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!841
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/566-arraylist-allocations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #566
The allocations #526 added to the conformance budgets had one source, and this PR removes it:
ArrayListis a 32-byte record (Buffer16, start 8, count 8), so every aggregate that holds one next to one more word or a tag crossed the old 32-byteinlineSizeLimitand became a counted block. The limit is now 48 (compiler/src/ir/layout.trb).Attribution (R1, R2)
The probe at limit 48 was measured by tier B of this PR; the numbers are budgets of
tests/conformance/*.allocations.parallel-orderedparallel-textsparallel-sourcesnested-writechecked-literalsThe source is one: aggregates (
Option,Result, tuples, records, theListIteratorof afor) that hold the 32-byte record. The proof is the probe, not a per-program trace: raising the one limit returns these programs to their pre-#526 counts exactly.list-iterategoes from 62 to 22 blocks for the same reason.In total 180 budgets fall by 8570 blocks; against main (
e0faa0ce) the net is -8427. Of the 156 programs #526 raised (+8514), 142 are at or under their value from before #526; 14 are above it by 3145 blocks together.Removed in this PR, kept because
encoding-decode-problems+106,encoding-decode-errors+17,non-ascii-paths+11,long-paths+8,file-values+1. They run throughIoErrorandPath; the cause is not isolated, so the budgets are the measured values and the isolation is #842.network-lookup: 46742, 529 above the #529 value (46213) and 623 under main (47365);feat(dns)11fe42c9added 1152 in between and a probe of that commit alone is needed to split the 529. It joins #842.Cost (R6)
tools/collection-cost.sh, head against merge basee0faa0ce, fastest of nine, µs:list-indexlist-iteratearray-writebuffer-writelist-slicelist-write-sharedlist-literalVM, fastest of three:
list-index38565 to 38830 ms,list-iterate20268 to 18928 ms.bytes-passratio 0.37 (bound 1.10).list-index(+3.7 %) andbuffer-write(+4.1 %) are noise: identical allocations,buffer-writeholds noArrayList, and the C column moved by as much (decided indocs/design/COLLECTION-STORAGE.md, section 6).Changes
compiler/src/ir/layout.trb:inlineSizeLimit32 to 48; four compiler tests grow their boxed-record fixture to 7 fields so it stays over the limit.tests/conformance/*.allocations: 185 files,records.trbto 7 fields,counted-for-write-to-listat 6.docs/design/COLLECTION-STORAGE.md(section 6, the allocations of slice 1),BACKEND.md,PERFORMANCE.md,CLOSED-TRAITS.md: 48 bytes, the decisions and the tables.No
seed/change. CI must run again after the rebase onto main7e267913(the newphp-listsbudget has not been measured at limit 48).0cc3fba94f42187d8af0928f425667c12e1f03fdWIP: perf(collections): win back the allocations of ArrayList over Bufferto perf(collections): win back the allocations of ArrayList over BufferApproved at
dfe1a61a.records.trbis adapted with the sum unchanged. CI is green on exactly this head (tier A, tier B, bootstrap, JS, PHP, cross-host C, playground, pdisc, gates), tier B being the run that counts every.allocationsbudget.inlineSizeLimit32 to 48,compiler/src/ir/layout.trb), and the doc comments match. It stays belowresultByValueLimit(64). The attribution (aggregates holding the 32-byteArrayListrecord crossing the old limit) is backed by the probe, and the five programs andnetwork-lookupthat stay above their old values are named with numbers and an issue (#842).COLLECTION-STORAGE.md; the two +4 % rows have identical allocation counts and are explained as noise.ArrayListoverBuffer) and nothing more; there are no seed, workflow or dependency changes.COLLECTION-STORAGE.mdsection 6,BACKEND.md,PERFORMANCE.mdandCLOSED-TRAITS.mdare updated; no INDEX.md in the diff.php-lists.allocationsis unchanged at 107 on this head and tier B passed, so it holds.Non-blocking: the PR body says CI must run again after the rebase; it did, and it is green.