Avoid repeated work when building and looking up host drive mounts #34

Open
github-bot wants to merge 2 commits from github-bot/gh-34 into main AGit
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-26 06:29 UTC · original
RavenCurseBurg:perf/posix-mount-lookup → main · +40 −41 · 2 files · 2 commits · open

DriveMap::default_map() generates 26 distinct, normalized entries but then sends them through the arbitrary-input validator, which checks for duplicates and builds a second vector. This constructs the default map directly in one reserved vector. Custom mappings still use the existing validation.

The other commit reuses the longest-prefix match in posix_to_windows(). It removes a second normalization and a search for a mount just matched by drive. Both changes preserve the public interface.

  • On Windows x86-64 with GCC 15.2 (-O3), seven alternating trials of 200,000 default constructions each measured a median of 826 → 243 ns per construction and 7 → 1 heap allocations. The comparison for this measurement used the first commit as its baseline. The regression checks all 26 drive letters.
  • For lookup, I compared 1,848 public results and diagnostic strings across default, nested, root and empty maps. The final branch matched current main byte for byte and passed all three native CTests. The earlier lookup comparison also passed on both MSVC and Ubuntu GCC. Windows and Linux comparison

I repeated the default-map benchmark against main on two hosted runners. Construction used 10 → 1 allocations on Windows/MSVC (1,684 → 328 ns) and 7 → 1 on Ubuntu/GCC (884 → 328 ns). Both runners also confirmed all 1,848 public lookup results matched main. Windows job · Ubuntu job · Benchmark source

Timings measure the host-side utilities. AI-assisted with Codex + GPT-6.2 Astra (xhigh).

**@⁠RavenCurseBurg** on GitHub · 2026-11-26 06:29 UTC · [original](https://github.com/JamesCicada/GTAVI-Recomp/pull/34) `RavenCurseBurg:perf/posix-mount-lookup` → `main` · +40 −41 · 2 files · 2 commits · open `DriveMap::default_map()` generates 26 distinct, normalized entries but then sends them through the arbitrary-input validator, which checks for duplicates and builds a second vector. This constructs the default map directly in one reserved vector. Custom mappings still use the existing validation. The other commit reuses the longest-prefix match in `posix_to_windows()`. It removes a second normalization and a search for a mount just matched by drive. Both changes preserve the public interface. - On Windows x86-64 with GCC 15.2 (`-O3`), seven alternating trials of 200,000 default constructions each measured a median of 826 → 243 ns per construction and 7 → 1 heap allocations. The comparison for this measurement used the first commit as its baseline. The regression checks all 26 drive letters. - For lookup, I compared 1,848 public results and diagnostic strings across default, nested, root and empty maps. The final branch matched current `main` byte for byte and passed all three native CTests. The earlier lookup comparison also passed on both MSVC and Ubuntu GCC. [Windows and Linux comparison](https://github.com/RavenCurseBurg/GTAVI-Recomp/actions/runs/45660587061) I repeated the default-map benchmark against `main` on two hosted runners. Construction used 10 → 1 allocations on Windows/MSVC (1,684 → 328 ns) and 7 → 1 on Ubuntu/GCC (884 → 328 ns). Both runners also confirmed all 1,848 public lookup results matched `main`. [Windows job](https://github.com/RavenCurseBurg/GTAVI-Recomp/actions/runs/45768862190/job/139736361541) · [Ubuntu job](https://github.com/RavenCurseBurg/GTAVI-Recomp/actions/runs/45768862190/job/139736361898) · [Benchmark source](https://github.com/RavenCurseBurg/GTAVI-Recomp/blob/4ecb18a/verification/factory.cpp) Timings measure the host-side utilities. AI-assisted with Codex + GPT-6.2 Astra (xhigh).
Normalize the POSIX path once and format the result directly from the longest matching mount. This avoids a second normalized string and an extra lookup by drive letter.

AI-assisted with Codex + GPT-6.2 Astra (xhigh).
AI-assisted with Codex + GPT-6.2 Astra (xhigh).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:44:52 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/34/head:github-bot/gh-34'
git switch 'github-bot/gh-34'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-34'
git switch 'github-bot/gh-34'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-34'
git switch 'github-bot/gh-34'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-34'
git switch 'main'
git merge --squash 'github-bot/gh-34'
git switch 'main'
git merge --ff-only 'github-bot/gh-34'
git switch 'main'
git merge 'github-bot/gh-34'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.