-
Notifications
You must be signed in to change notification settings - Fork 9
feat(shiki): use wasm engine #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 withcreateOnigurumaEngine
- Updated highlighter initialization to use dynamic WASM import
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ 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. 🚀 New features to boost your workflow:
|
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. |
Using the WASM generator rather than the JS one results in ~50% cheaper runs.