Skip to content

Add benchmarks for width and grapheme performance - #302

Merged
jquast merged 2 commits into
masterfrom
jq/benchmarks
Oct 23, 2026
Merged

jquast merged 2 commits into
masterfrom
jq/benchmarks

Conversation

@jquast

@jquast jquast commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Put in some new tests for baseline of upcoming branch that adjusts performance

@codspeed

codspeed Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by ×6.7

1 warning

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

⚡ 22 improved benchmarks
✅ 99 untouched benchmarks
🆕 16 new benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ test_wcswidth_ri_flags_paired 10,040.7 µs 438.4 µs ×23
⚡ test_width_ri_flags_paired 10,073.2 µs 444.5 µs ×23
⚡ test_wcstwidth_ri_term_program[ghostty] 10,187.5 µs 477 µs ×21
⚡ test_width_ri_term_program[ghostty] 10,219.7 µs 482.2 µs ×21
⚡ test_wcswidth_ri_flags_unpaired 2,551.6 µs 132.4 µs ×19
⚡ test_wcstwidth_ri_term_program[xterm.js] 10,623.7 µs 564.9 µs ×19
⚡ test_width_ri_flags_unpaired 2,563.1 µs 136.6 µs ×19
⚡ test_width_ri_term_program[xterm.js] 10,655.9 µs 570.1 µs ×19
⚡ test_ljust_udhr_lines 38.9 ms 8.2 ms ×4.7
⚡ test_width_fastpath_integrity_udhr 39.4 ms 8.4 ms ×4.7
⚡ test_wrap_udhr 2,931.1 ms 623 ms ×4.7
⚡ test_width_wcswidth_consistency_udhr 32.2 ms 6.9 ms ×4.7
⚡ test_width_udhr_lines 20 ms 4.3 ms ×4.7
⚡ test_width_udhr 25.4 ms 6.1 ms ×4.2
⚡ test_width_decomposed 208.6 µs 60.7 µs ×3.4
⚡ test_width_composed 173.6 µs 54.2 µs ×3.2
⚡ test_wcswidth_decomposed 144.7 µs 50 µs ×2.9
⚡ test_width_brahmic_devanagari 166.9 µs 58.2 µs ×2.9
⚡ test_width_brahmic_bengali 156.3 µs 55.7 µs ×2.8
⚡ test_wcswidth_composed 120.5 µs 45.1 µs ×2.7
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

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


Comparing jq/benchmarks (8c04831) with master (f22d465)

Open in CodSpeed

@jquast

jquast commented Oct 23, 2026

Copy link
Copy Markdown
Owner Author

I'm going to reduce the multipliers/size of larger tests in this next commit, to reduce overall "wall time" of benchmarks, but they might show up as degrading performance

@jquast

jquast commented Oct 23, 2026

Copy link
Copy Markdown
Owner Author

As expected, this shows "x6.7" overall improvement, this is not true, this is offering a new baseline to execute in a shorter amount of time, this CI test is usually the last to report in before this change.

@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.84%. Comparing base (f22d465) to head (8c04831).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #302      +/-   ##
==========================================
+ Coverage   87.82%   87.84%   +0.01%     
==========================================
  Files          41       41              
  Lines        5625     5625              
  Branches     1510     1510              
==========================================
+ Hits         4940     4941       +1     
  Misses        319      319              
+ Partials      366      365       -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.

@jquast
jquast merged commit 4bb1017 into master Oct 23, 2026
38 checks passed
@jquast
jquast deleted the jq/benchmarks branch October 23, 2026 17:34
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