benchmarks: add end-to-end scroll and caret movement suites#52
Merged
Conversation
Adds two new benchmark classes that exercise the full input→render pipeline via real key injection, layout, and draw cycles: - EndToEndScrollBenchmarks: arrow ↓/↑/→/← and PageDown/PageUp from one end of the document to the other, rendering after every keypress. Each benchmark checks viewport/caret state to detect when the boundary is reached. - CaretMovementBenchmarks: caret movement with scroll-event counting (detects each viewport shift at edges), plus Home/End and Ctrl+Home/End oscillation stress tests. Also adds EditorHarness — a lightweight sync wrapper around Application.Create + ANSI driver + Editor that BenchmarkDotNet can manage without async disposal. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Application.Create+ ANSI driver +Editorfor BenchmarkDotNet.These complement the isolated-layer benchmarks from #50 by measuring what the user actually experiences: keypress → caret move → viewport scroll → full redraw.
EndToEndScrollBenchmarks
CaretMovementBenchmarks
Sample results (ShortRun, Apple M4 Max, 1K-line doc)
The vertical scroll numbers (1.3s for 1K lines, 5.2 GB allocated) make the case for visual-line caching (#49) very clearly — each of the 1K arrow-down steps rebuilds all 24 visible lines from scratch.
Running
Test plan
dotnet build Terminal.Gui.Text.slnxsucceedsdotnet format --verify-no-changespasses🤖 Generated with Claude Code