Reserve descriptor sync result buffers once #42
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-logs
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/linkoovosh--LinkoArts-build!42
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-42"
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?
@avt0m4t48 on GitHub · 2026-12-03 05:15 UTC · original
avt0m4t48:perf-reserve-descriptor-sync-results→main· +9 −1 · 1 files · 1 commits · draftChange
Sum the worker result lengths after the scan and reserve each aggregate once. The original consuming loop still adds the same counters, merges slot indexes in worker order and releases the worker buffers at the same points. The sizing pass has exclusive access to the worker mutexes and does not lock them.
Measurement
In 24 paired synthetic Linux x86-64 rounds, the common layout's dense twenty-worker assembly went from 4.99 to 2.65 µs, and an eighty-worker mixed layout went from 11.64 to 7.49 µs. The layout with additional NVIDIA diagnostic counters went from 4.90 to 2.66 µs and 11.42 to 7.39 µs in the same cases. A second fixture reduced the dense 160-page case from ten growth reallocations to zero on both layouts.
Empty rounds can be slightly slower. In the NVIDIA-fork x86-64-v3 fixture, twenty empty workers added about 66 ns. Reserving earlier can also increase the momentary overlap between the worker and destination buffers. The queued wait vector holds only the reserved slot count on the tested allocator.
Verification
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.