Keep allocations on fewer pages

Page-local free-space tracking cut Nyxus heap charges by 15.82% and total instructions by 8.82% in a matched 16-canister run. Both builds finished in 29.4 simulated seconds.

Keep free-space bookkeeping on the page

The earlier transient allocator kept free-block lists that could point across many pages. The replacement tracks free buddy blocks in a bitmap on each page and groups available pages into bins by the largest block they can supply. When a block is freed, the allocator can merge it with its buddy and move the page to a different bin. A fully empty page goes back to the underlying provider. Small allocations still use slabs. Keeping more bookkeeping local reduces the number of pages allocation and free operations need to touch.

Compare the same Heavy16 work

The PocketIC comparison ran the same workflow graphs across 16 canisters, with 18,000 root workflows, 1,200 children, 594,000 steps and 360,000 Wire items per build. Nyxus went from 105.15 billion to 95.88 billion complete instructions. Its heap page component fell from 61.37 billion to 51.66 billion. Both runs took 29.4 simulated seconds and reached the same Wasm capacity and used no stable memory. The totals include bounded maintenance, with preparation excluded and observer queries reported separately.

Check the tradeoff on each backend

Hylix saved 0.80% in complete instructions and finished in 38.4 simulated seconds, down from 39.6. Its median latency rose from 19.8 to 20.4 simulated seconds, and its peak stable capacity increased by 5.0625 MiB. The comparison measures the allocator change as a whole, including how allocations end up placed. Instruction cost, completion time, latency and memory use each tell part of the story.

Code, tests, and related material