-
-
Notifications
You must be signed in to change notification settings - Fork 61
Add npm
package using napi-rs
#182
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
base: main
Are you sure you want to change the base?
Conversation
Wow, cool work! It’s a lot, will take some time to review. And, also I am sure you can find stuff if you self-review. |
Here is the benchmark result on the Zod v3 mdx documentation clk: ~3.25 GHz
cpu: Apple M2 Pro
runtime: node 24.2.0 (arm64-darwin)
benchmark avg (min … max) p75 / p99 (min … top 1%)
--------------------------------------------------- -------------------------------
markdown-rs parse 16.33 ms/iter 16.57 ms █▄
(15.29 ms … 17.08 ms) 17.04 ms ▅ ▅ ▅██ ▅ ▅
( 1.21 mb … 1.22 mb) 1.21 mb ▅▁▁▁▅█▅█▅█▁█████▅▅█▁█
remark parse 42.02 ms/iter 43.75 ms ██
(39.96 ms … 46.92 ms) 46.26 ms ██
( 10.46 mb … 44.35 mb) 15.31 mb ███▁██▁▁▁▁▁▁█▁▁▁▁█▁▁█
summary
markdown-rs parse
2.57x faster than remark parse
--------------------------------------------------- -------------------------------
markdown-rs parse without parsing js 16.14 ms/iter 16.31 ms █
(15.63 ms … 16.81 ms) 16.64 ms ▅ ▅▅█ ▅ ▅ ▅
( 1.21 mb … 1.21 mb) 1.21 mb ▅▅█▅▁█▅████████▁█▅▁▅▅
remark parse 41.73 ms/iter 41.63 ms █
(39.68 ms … 47.57 ms) 45.96 ms █ ██
(841.99 kb … 14.55 mb) 11.21 mb █▁█████▁▁▁▁█▁▁▁▁▁▁▁▁█
summary
markdown-rs parse without parsing js
2.59x faster than remark parse
--------------------------------------------------- -------------------------------
markdown-rs html 7.86 ms/iter 8.03 ms ▃ █▃
(7.34 ms … 8.29 ms) 8.29 ms ▃█▆▃█▃███ ▃▃ ▃ ▃▃
(186.48 kb … 186.64 kb) 186.51 kb ▄▆▄▁█████████████████
remark html 41.38 ms/iter 42.53 ms █
(39.16 ms … 46.77 ms) 43.76 ms ▅▅▅▅█ ▅ ▅ ▅ ▅ ▅ ▅
( 6.65 mb … 14.85 mb) 12.03 mb █████▁█▁█▁▁█▁▁▁█▁█▁▁█
summary
markdown-rs html
5.27x faster than remark html
|
Notice that the bigger files like The important parts live in the |
Fix #6
The npm package is currently published as @xmorse/markdown-rs
This npm package will also support WASM. Most of the CI has been ported from the oxc-resolver package.
Still a WIP, the exported functions need to be thought out better, for now I am experimenting.
Things to do before merge:
@xmorse/markdown-rs
tomarkdown-rs
(or other available name)