perf(tools): bound trace timeline layout memory by the slice cap #28918
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28918"
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?
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-12-04T16:58:12Z.
What
Select the longest clipped slices directly from an iterator when generating the HTML timeline. Count every visible slice and collect its thread while selecting the bars, so the page retains its thread rows, omitted-slice count, present markers and tie order. The rendering pass keeps at most the requested number of bars plus per-thread state.
Tested
Linux x86-64, Python 3.14.10. All 194 tests in
python3 -B -m unittest discover -s tools/tests -p 'test_trace*.py'and the conventions check passed. Compared 600 generated layouts across zero and positive caps, thread filters and clipped windows. The default CLI output was byte-identical on a retained Smurfs village trace with 850,316 visible slices and 5,000 bars drawn. The changes also passed all 33 timeline tests when combined with #28352.Measured clipping and layout after parsing the same capture once on main
82a605ad2c23and this branch. CPU time is the median of six alternating runs per version. Python allocation peaks were sampled in separate runs.The full CLI peaked at about 800 MiB on both versions. Trace loading alone peaked at about 795 MiB.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.