perf: join adjacent title-memory copies by default #705

Open
pixelpulsexd wants to merge 1 commit from upstream-pr/705 into main
pixelpulsexd commented 2026-11-25 05:15:54 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by pixelpulsexd on 2026-11-25T05:15:54Z.


Summary

This PR enables joining adjacent title-memory copies by default to reduce memory-copy overhead during gameplay.

Motivation

Run 86 logged 14,042 kernel copy calls per frame, involving approximately 480-byte copies.

These operations accounted for approximately 19 ms, including refreshes.

Changes

  • Join adjacent deferred copies by default.
  • Add VICTORY_JOIN_COPIES=0 to restore the previous behavior.
  • Preserve continues() validation.
  • Continue rejecting gaps and self-overlapping copies.
  • Preserve per-page fallback behavior for unmapped pages.

Expected benefits

  • Reduce the number of kernel copy calls.
  • Reduce memory-copy overhead.
  • Improve frame-time efficiency.

Testing

  • Verify default behavior.
  • Verify VICTORY_JOIN_COPIES=0.
  • Test unmapped-page fallback.
  • Verify gaps and self-overlapping copies are still rejected.
  • Compare before/after performance.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6597739503 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/705). Originally posted by [pixelpulsexd](https://github.com/pixelpulsexd) on 2026-11-25T05:15:54Z. --- ## Summary This PR enables joining adjacent title-memory copies by default to reduce memory-copy overhead during gameplay. ### Motivation Run 86 logged 14,042 kernel copy calls per frame, involving approximately 480-byte copies. These operations accounted for approximately 19 ms, including refreshes. ### Changes - Join adjacent deferred copies by default. - Add `VICTORY_JOIN_COPIES=0` to restore the previous behavior. - Preserve `continues()` validation. - Continue rejecting gaps and self-overlapping copies. - Preserve per-page fallback behavior for unmapped pages. ### Expected benefits - Reduce the number of kernel copy calls. - Reduce memory-copy overhead. - Improve frame-time efficiency. ### Testing - [ ] Verify default behavior. - [ ] Verify `VICTORY_JOIN_COPIES=0`. - [ ] Test unmapped-page fallback. - [ ] Verify gaps and self-overlapping copies are still rejected. - [ ] Compare before/after performance.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/705:upstream-pr/705'
git switch 'upstream-pr/705'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/705'
git switch 'upstream-pr/705'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/705'
git switch 'upstream-pr/705'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/705'
git switch 'main'
git merge --squash 'upstream-pr/705'
git switch 'main'
git merge --ff-only 'upstream-pr/705'
git switch 'main'
git merge 'upstream-pr/705'
git push origin 'main'
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
fxceless/victory-fork!705
No description provided.