Skip to content

Preserve cell styles when clipping overtyped text+perf - #315

Merged
jquast merged 8 commits into
masterfrom
perf/clip-overtyping-styles
Nov 9, 2026
Merged

jquast merged 8 commits into
masterfrom
perf/clip-overtyping-styles

Conversation

@jquast

@jquast jquast commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

This branch is #305 with significant performance improvements. Closes #305.

civilwarinfrance and others added 4 commits October 29, 2026 03:04
Parse each SGR once only while painting, and 'queue' the parsed
parameters, memoize the state apply and sequence builder. Use tuples for
cell style instead of a 'parallel dict'.
@codspeed

codspeed Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 28.02%

1 warning

⚠️ 2 benchmarks with a significant change ran on different hardware

Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚡ 2 improved benchmarks
✅ 135 untouched benchmarks
🆕 5 new benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ test_clip_dense_ansi_control_codes_ignore 734.9 µs 553.7 µs +32.71%
⚡ test_wrap_complex_sgr 1,085.1 µs 878.6 µs +23.5%
🆕 test_clip_overtyping_many_styles N/A 9.4 ms N/A
🆕 test_clip_overtyping_plain_overwrite N/A 7.6 ms N/A
🆕 test_clip_overtyping_style_churn N/A 5.4 ms N/A
🆕 test_clip_overtyping_styled_overwrite N/A 2.6 ms N/A
🆕 test_propagate_sgr_repeated_styles N/A 59.6 µs N/A

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing perf/clip-overtyping-styles (61eef1b) with master (0e30e30)

Open in CodSpeed

@jquast
jquast merged commit 45c4002 into master Nov 9, 2026
34 checks passed
@jquast
jquast deleted the perf/clip-overtyping-styles branch November 9, 2026 20:20
@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.16%. Comparing base (0e30e30) to head (61eef1b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #315      +/-   ##
==========================================
+ Coverage   88.14%   88.16%   +0.02%     
==========================================
  Files          41       41              
  Lines        5634     5645      +11     
  Branches     1508     1513       +5     
==========================================
+ Hits         4966     4977      +11     
  Misses        318      318              
  Partials      350      350              

☔ 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.

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.

2 participants