perf(tools): read checker file contents through one git cat-file process #5748

Merged
AlexOfTheForest merged 1 commit from upstream-pr/5748 into main 2026-10-14 14:15:34 +00:00
AlexOfTheForest commented 2026-10-14 09:15:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlexOfTheForest on 2026-10-14T09:15:02Z.


What

Check read every technical debt file and every changed file with its own git show, so each run started one git process per file, and the count grew with docs/dev/debt. Process start-up dominates on Windows.

The blobs the checks use are now read in one git cat-file --batch process, keyed by the object ids ls-tree already returns, and duplicates() batches the files it inspects the same way. Paths that are not cached still go through git show, so failures are unchanged.

Git processes per run (Linux, wrapper counting every git start):

Run Before After
Typical pull request (3 files) 99 7
118-file range (main~40..main) 311 8
test_check_conventions_comments.py (#5672) 505 429

Refs #5672. This removes the checker's per-file processes, but most of that test's processes come from its own repository setup, so it complements the sharding in #5678 rather than replacing it (the two merge cleanly).

Tested

Linux, relinker-only build: ctest passes 159/159 with --timeout 30. New conventions_blob_reads fails on main (11 git show with two debt files, 49 with forty) and passes with this change. All tools/tests pass. Checker output is byte-identical before and after on 40 three-commit ranges of main history, including one with a finding. Not measured on Windows.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: Yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4855628502 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5748). Originally posted by [AlexOfTheForest](https://github.com/AlexOfTheForest) on 2026-10-14T09:15:02Z. --- ### What `Check` read every technical debt file and every changed file with its own `git show`, so each run started one git process per file, and the count grew with `docs/dev/debt`. Process start-up dominates on Windows. The blobs the checks use are now read in one `git cat-file --batch` process, keyed by the object ids `ls-tree` already returns, and `duplicates()` batches the files it inspects the same way. Paths that are not cached still go through `git show`, so failures are unchanged. Git processes per run (Linux, wrapper counting every `git` start): | Run | Before | After | |---|---|---| | Typical pull request (3 files) | 99 | 7 | | 118-file range (`main~40..main`) | 311 | 8 | | `test_check_conventions_comments.py` (#5672) | 505 | 429 | Refs #5672. This removes the checker's per-file processes, but most of that test's processes come from its own repository setup, so it complements the sharding in #5678 rather than replacing it (the two merge cleanly). ### Tested Linux, relinker-only build: ctest passes 159/159 with `--timeout 30`. New `conventions_blob_reads` fails on main (11 `git show` with two debt files, 49 with forty) and passes with this change. All `tools/tests` pass. Checker output is byte-identical before and after on 40 three-commit ranges of `main` history, including one with a finding. Not measured on Windows. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: Yes
github-actions[bot] commented 2026-10-14 10:28:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T10:28:38Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#5780 tools/check_conventions.py L135-138
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166286860 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5748#issuecomment-6166286860). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-14T10:28:38Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #5780 | `tools/check_conventions.py` [L135-138](https://github.com/boykopovar/AnyPS5/blob/da9a65d8ed68a99ddcc1e2110b2ea0e914605481/tools/check_conventions.py#L135-L138) | | |
adriadam10 commented 2026-10-14 13:18:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T13:18:53Z.


Checked: the batched reads fall back to git show for uncached paths, missing objects are skipped by the header check, and conventions_blob_reads fails without the change (process count grows with debt files) and passes with it. Conventions and relinker CI green; merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6169297923 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5748#issuecomment-6169297923). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T13:18:53Z. --- Checked: the batched reads fall back to `git show` for uncached paths, missing objects are skipped by the header check, and `conventions_blob_reads` fails without the change (process count grows with debt files) and passes with it. Conventions and relinker CI green; merging.
AlexOfTheForest commented 2026-10-14 13:23:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlexOfTheForest on 2026-10-14T13:23:26Z.


Checked: the batched reads fall back to git show for uncached paths, missing objects are skipped by the header check, and conventions_blob_reads fails without the change (process count grows with debt files) and passes with it. Conventions and relinker CI green; merging.

Thanks ;)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6169384811 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5748#issuecomment-6169384811). Originally posted by [AlexOfTheForest](https://github.com/AlexOfTheForest) on 2026-10-14T13:23:26Z. --- > Checked: the batched reads fall back to git show for uncached paths, missing objects are skipped by the header check, and conventions_blob_reads fails without the change (process count grows with debt files) and passes with it. Conventions and relinker CI green; merging. Thanks ;)
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
boykopovar/AnyPS5!5748
No description provided.