Skip to content

perf(windows): draw the caret as its own visual and add the row count and results per run settings - #4243

Merged
datlechin merged 3 commits into
mainfrom
fix/perf-windows-settings
Nov 12, 2026
Merged

datlechin merged 3 commits into
mainfrom
fix/perf-windows-settings

Conversation

@datlechin

@datlechin datlechin commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Caret: the editor's carets are a composition visual of their own over the swap chain (ElementCompositionPreview.SetElementChildVisual on the SwapChainPanel, one SpriteVisual per visible caret, clipped at the gutter, snapped to pixels). A frame places them where it laid the text out; a blink, focus change or window activation only shows or hides the visual. WinUI's own TextBox keeps its caret in a child element too. ADR 0002 updated. (WIN-07)
  • Settings > Pagination > Count rows if estimate less than: 1,000, 10,000, 100,000, 1,000,000 or Always count, 100,000 by default, the label, choices and meaning of the macOS setting. It replaces the constant a table tab used. ADR 0004 updated. (FU-06)
  • Settings > Queries > Results kept per run: No limit (default), 10, 20, 50, 100, 200, 500 or 1,000, as on macOS. Past the limit a run keeps its newest results with rows, the run's status line (a stopped run's too) ends with "N earlier results were dropped.", and the grid shows the first result kept. A dropped result's rows are let go in the core through a new QueryRun::release_set; the one the grid shows stays until the run ends or another is picked. (FU-05)
  • Docs: docs(windows): count threshold and results kept per run settings docs#223.
  • Storage: two new keys in settings.json, countRowsIfEstimateLessThan and resultSetsKeptPerRun. An older build skips them; a file without them reads as 100,000 and no limit.
Measure Before After
Frames presented per caret blink toggle, windows-2025, 3 runs each (temporary probe, run 43277097648) 1 (10 in a 5 s blink, plus 1 for focus) 0 (10 toggles, 0 frames)
Result sets the pane holds after a 10,000-set script with the limit at 100 (RunResultsTests) 10,000 100
Core stores a run holds for sets the limit dropped (Interop test) all, until the next run none

Needs the maintainer

  • After a run past the limit, the grid shows the first result kept, as Windows shows a run's first result today; the shared spec has macOS show the newest. Easy to switch in ShowFirstKept.
  • The Settings description leaves out the macOS footer's "Pinned results always stay.": the Windows app has no pinned results.

Test plan

  • Editor.Tests (Windows CI): TheCaretStopsBlinkingAfterTheCaretTimeoutAndNoFrameFollows changes on purpose, now TheCaretBlinksWithNoFrameAndStopsAfterTheCaretTimeout: it asserted at least 2 frames while the caret blinked, it now asserts none while the visual toggles. TheCaretShowsOverTheTextAndTheBlinkHidesIt reads the screen at the caret with it shown and hidden.
  • App.Model: TableTabCountTests threshold theory and refresh, RunResultsTests limit cases, QueryTabTests setting per run, StoreTests round trips and files without the keys.
  • Interop: AReleasedSetIsGoneFromTheRunAndAHandleStillHeldReadsOn. FFI: a_released_set_is_gone_from_the_run_and_the_later_sets_keep_their_index.
  • UI: ARunPastTheResultLimitKeepsTheNewestAndSaysHowManyWent.
  • Probe (temporary branch, deleted): the same test on main's editor and on this branch counted frames and caret toggles from focus to the end of the blink; numbers above. The new CaretTests passed there on x64.
  • This Mac: solution build, solution tests (573 passed), FFI run-state tests, bindings regenerated. The app, its UI tests, DataGrid.Tests and Editor.Tests build and run only in the Windows jobs.

@datlechin
datlechin enabled auto-merge (squash) November 12, 2026 19:52
@datlechin
datlechin merged commit 69acecb into main Nov 12, 2026
64 of 67 checks passed
@datlechin
datlechin deleted the fix/perf-windows-settings branch November 13, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant