Skip to content

Conversation

@avivkeller
Copy link
Member

Using the WASM generator rather than the JS one results in ~50% cheaper runs.

Copilot AI review requested due to automatic review settings June 25, 2025 15:14
@avivkeller avivkeller requested a review from a team as a code owner June 25, 2025 15:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR switches Shiki’s syntax highlighter from the JavaScript regex engine to the faster Oniguruma WASM engine, reducing execution cost by ~50%.

  • Replaced createJavaScriptRegexEngine import and usage with createOnigurumaEngine
  • Updated highlighter initialization to use dynamic WASM import

@codecov
Copy link

codecov bot commented Jun 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.57%. Comparing base (b3e2fbd) to head (3f70af7).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #320       +/-   ##
===========================================
+ Coverage   51.15%   66.57%   +15.42%     
===========================================
  Files          81       81               
  Lines        6956     6956               
  Branches      306      339       +33     
===========================================
+ Hits         3558     4631     +1073     
+ Misses       3395     2322     -1073     
  Partials        3        3               

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@avivkeller avivkeller added the fast track This PR can land before the typical review time, with a :+1: from collaborators label Jun 26, 2025
@avivkeller
Copy link
Member Author

avivkeller commented Jun 26, 2025

Requesting fast-track so I can improve other aspects of Shiki's speed without conflicts.

Edit: Nevermind, the improvement I had in mind did not improve speeds.

@avivkeller avivkeller removed the fast track This PR can land before the typical review time, with a :+1: from collaborators label Jun 26, 2025
@AugustinMauroy AugustinMauroy merged commit 2faca0b into main Jun 26, 2025
10 checks passed
@AugustinMauroy AugustinMauroy deleted the shiki-wasm branch June 26, 2025 19:50
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.

4 participants