Skip to content

Performance improvements - span, ascii fast path, viewport optimization - #307

Merged
waf merged 1 commit into
mainfrom
performance-improvements-span
Aug 16, 2026
Merged

Performance improvements - span, ascii fast path, viewport optimization#307
waf merged 1 commit into
mainfrom
performance-improvements-span

Conversation

@waf

@waf waf commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Per-change (benchmarks, 1000-line document):

  • ASCII width memo table: memoized wcwidth for ASCII character ranges. 11,776 µs to 474 µs.
  • Viewport-scoped highlight lookup: build the span dictionary from visible lines only, not the whole document. 826 µs to 627 µs on navigate.
  • Boundary scans over cached text: replaced O(chunks) StringBuilder indexer walks with a span search (which is vectorized): 285 ns to 4.4 ns on Home/End keypresses
  • GetWidth(span) ASCII fast path: skip the walking algorithm across printable-ASCII runs : 33.7 µs to 64 ns on completion-pane rendering.

@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.7%. Comparing base (b7bbd3d) to head (ff63588).

Files with missing lines Patch % Lines
src/PrettyPrompt/Highlighting/CellRenderer.cs 57.1% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #307     +/-   ##
=======================================
+ Coverage   86.6%   86.7%   +0.1%     
=======================================
  Files         48      48             
  Lines       4131    4165     +34     
  Branches     685     691      +6     
=======================================
+ Hits        3581    3615     +34     
- Misses       383     384      +1     
+ Partials     167     166      -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@waf
waf merged commit 2802bf9 into main Aug 16, 2026
3 checks passed
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