Skip to content

Cut per frame, per verification and per scan work found in the review - #884

Merged
SimonCropp merged 3 commits into
mainfrom
fix-perf
Sep 23, 2026
Merged

SimonCropp merged 3 commits into
mainfrom
fix-perf

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

The perf items from the review in todo.md that could be changed and checked here.

  • Queue projection grouped entries and detected label collisions pairwise, every frame and twice per change under the lock. Group keys are now worked out once per entry and collisions counted in a dictionary.
  • ProcessCleanup built a string of every process's command line on each passing verification, even with logging off. It is now only built when logging is on.
  • The selection summary built the whole selected text every frame to measure it. It is now counted from the spans.
  • DiffPlex diffed the words of every modified line pair to fill sub-pieces nothing reads. Lines are now their own single word, so that pass is trivial.
  • The Windows frame wait slept about 31ms rather than 16, and kept waking 60 times a second while hidden. It now waits for input or the next frame, and 100ms at a time while hidden.
  • Long rows were laid out whole every frame, though nothing scrolls horizontally. The Windows canvas and the native payload now clip them to the window.
  • raylib spun for the end of every frame. Its partial busy wait is off.
  • InlineStaging.Clear read and parsed every staged patch on each verification. It now re-reads a directory only when its write time changes.
  • The tray's accept retried a move eight times over three seconds on the UI thread even when the target was read-only or its directory missing. It now gives up at once for those.
  • The tray's scan re-read every equal-size, differing pair every two seconds. A pair found different and unchanged since is skipped.
  • PiperClient connected to the tray's port after the tray had exited, which costs two seconds where the SYN is dropped. It now checks the listener table first, and traces the failure as before. The SendOnly snapshot changes to say nothing was listening.

Not done: the attached viewer's five-a-second full listing (needs a protocol change), macOS repainting every frame (Swift, which I could not build here), and caching scaled images in the Windows head.

The native changes (CMake flag) mean this push runs build-native, which should open its own PR with rebuilt binaries.

Run locally on Windows, all passing: DiffEngine.Tests 703, DiffEngineViewer.Tests 359, DiffEngineTray.Tests 246, and a Release build of the solution.

Eleven of the perf items in todo.md, each described in the pull request. The attached viewer's polling, macOS repainting and Windows image caching are left.
@SimonCropp SimonCropp added this to the 20.5.0 milestone Sep 23, 2026
PathEntriesAreUnquotedAndEmptiesDropped used | for an entry that cannot be a path, which is only invalid on Windows, so the Linux and macOS runs kept it and failed.
@SimonCropp
SimonCropp merged commit c37bf9e into main Sep 23, 2026
12 checks passed
@SimonCropp
SimonCropp deleted the fix-perf branch September 23, 2026 02:51
SimonCropp added a commit that referenced this pull request Sep 23, 2026
Every item that was unverified, checked on c37bf9e: all of them hold, and
none was fixed by #878, #881 or #884. Each now says whether it was reproduced,
verified by reading, or needs a platform this machine lacks, with the current
lines, the repro test names, and where the suggested fix turned out wrong or
incomplete.

An attached "Accept all in <solution>" deleting verified files whose snapshots
were not written moves to Data loss. The repro tests are on a local branch,
review-repros, rather than here: each fails until its item is fixed.
SimonCropp added a commit that referenced this pull request Sep 23, 2026
…885)

* Make the Linux viewer draw frames, read input and wait between them

raylib 6.0's CMake reads every SUPPORT_ flag in config.h into an option that
defaults to ON, including the ones config.h sets to 0, and CUSTOMIZE_BUILD
skips config.h's own values. So SUPPORT_CUSTOM_FRAME_CONTROL was on, and
EndDrawing never swapped a frame onto the screen, never polled input and never
waited for the next frame: the Linux window stayed blank and ignored every key
and click while the loop spun. SUPPORT_BUSY_WAIT_LOOP was on the same way, and
would have spun through the whole of every frame's wait once there was one.

Switch both off, with every other flag config.h defaults to 0, and turn off
SUPPORT_SCREEN_CAPTURE, whose F12 handler becomes reachable once input is read.

PixelTests.PresentWaitsForTheNextFrame times sixty presents against the
renderer the Ubuntu job builds. The pixel snapshots could never have noticed:
a capture draws into a texture and never reaches EndDrawing.

* Record what checking the review's unverified items found

Every item that was unverified, checked on c37bf9e: all of them hold, and
none was fixed by #878, #881 or #884. Each now says whether it was reproduced,
verified by reading, or needs a platform this machine lacks, with the current
lines, the repro test names, and where the suggested fix turned out wrong or
incomplete.

An attached "Accept all in <solution>" deleting verified files whose snapshots
were not written moves to Data loss. The repro tests are on a local branch,
review-repros, rather than here: each fails until its item is fixed.

* Rebuild native renderer binaries (#886)

Co-authored-by: SimonCropp <122666+SimonCropp@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: SimonCropp <122666+SimonCropp@users.noreply.github.com>
This was referenced Sep 23, 2026
This was referenced Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant