Skip to content

Conversation

@Timeless0911
Copy link
Contributor

@Timeless0911 Timeless0911 commented May 22, 2025

Summary

Replace commander with cac to improve cli performance.

Output Size

cac is 74kB smaller than commander

  • cac:
File (esm)                    Size       
dist/index.js                 130.4 kB
  • commander:
File (esm)                    Size       
dist/index.js                 204.5 kB

commander is prebundled before and above is what we bundled commander into index.js.

image

Startup Time

cac is 11ms faster than commander.

  • cac:
hyperfine --warmup 5 'node rslib.js build'
Benchmark 1: node /Users/bytedance/codes/rslib/packages/core/bin/rslib.js build
  Time (mean ± σ):      1.169 s ±  0.022 s    [User: 3.263 s, System: 0.324 s]
  Range (min … max):    1.135 s …  1.198 s    10 runs
  • commander:
hyperfine --warmup 5 'node rslib.js build'
Benchmark 1: node /Users/bytedance/codes/rslib/packages/core/bin/rslib.js build
  Time (mean ± σ):      1.148 s ±  0.023 s    [User: 3.259 s, System: 0.312 s]
  Range (min … max):    1.121 s …  1.188 s    10 runs

Related Links

https://github.com/cacjs/cac

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented May 22, 2025

Deploy Preview for rslib ready!

Name Link
🔨 Latest commit e605d86
🔍 Latest deploy log https://app.netlify.com/projects/rslib/deploys/682eeaa7c369060008b4eacc
😎 Deploy Preview https://deploy-preview-1012--rslib.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

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

🚀

@chenjiahan chenjiahan merged commit f4a2c10 into main May 22, 2025
18 checks passed
@chenjiahan chenjiahan deleted the chore/cac branch May 22, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants