benchmarks: add baseline scrolling performance suite#50
Merged
Conversation
Adds benchmarks/Terminal.Gui.Editor.Benchmarks with BenchmarkDotNet, covering the three hot-path layers that determine scroll fluency: - ScrollingBenchmarks: viewport-sized visual line builds at top/middle/ bottom, plus a full top-to-bottom scroll simulation. Parameterized by document size (100/1K/10K lines) and viewport height (24/50 rows). - VisualLineBuildBenchmarks: per-line build cost across content profiles (short ASCII, long line, tabbed, emoji/ZWJ, mixed CJK+tabs+emoji). - DocumentAccessBenchmarks: rope text extraction and line-tree lookups (sequential vs random) at 1K/10K/100K line scales. Run via: dotnet run --project benchmarks/Terminal.Gui.Editor.Benchmarks -c Release Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced May 11, 2026
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
benchmarks/Terminal.Gui.Editor.Benchmarksproject with BenchmarkDotNet, covering the three hot-path layers that determine scroll fluency.Terminal.Gui.Text.slnxand addsBenchmarkDotNet.Artifacts/to.gitignore.Benchmark suites
Running
Sample results (ShortRun, Apple M4 Max)
VisualLineBuild — per-line cost:
Scrolling — viewport builds (10K-line document, 50-row viewport):
The full-scroll number (42 ms for 10K lines) and the per-viewport allocation (~900 KB) confirm that visual-line caching (#49) is the right next optimization.
Test plan
dotnet build Terminal.Gui.Text.slnxsucceeds with benchmark project includeddotnet format --verify-no-changespasses--job Dry)🤖 Generated with Claude Code