-
Notifications
You must be signed in to change notification settings - Fork 220
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
perf(npm
): startup time reduce
#705
Conversation
Make test i'm getting these results ❯ make test
go test -cpu 24 -race -count=1 -timeout=30s ./...
? github.com/evilmartians/lefthook [no test files]
? github.com/evilmartians/lefthook/cmd [no test files]
ok github.com/evilmartians/lefthook/internal/config 1.318s
ok github.com/evilmartians/lefthook/internal/git 1.504s
? github.com/evilmartians/lefthook/internal/lefthook/runner/exec [no test files]
? github.com/evilmartians/lefthook/internal/templates [no test files]
? github.com/evilmartians/lefthook/internal/system [no test files]
? github.com/evilmartians/lefthook/internal/version [no test files]
ok github.com/evilmartians/lefthook/internal/lefthook 1.737s
ok github.com/evilmartians/lefthook/internal/lefthook/runner 1.287s
ok github.com/evilmartians/lefthook/internal/lefthook/runner/filters 1.730s
ok github.com/evilmartians/lefthook/internal/log 1.483s
lefthook on perf-cli-improvement [?] via 🐹 v1.22.2 took 11s
❯ It is okay to check |
Testing locally currently isn't possible because of locally it's failed. lefthook/packaging on perf-cli-improvement [?]
❯ make prepare
find npm/ -name 'README.md' -exec rm \{} \;
find npm/ -type f -name 'lefthook*' -exec rm \{} \;
git clean -fdX npm-installer/ npm-bundled/ npm-bundled/bin/
Removing npm-bundled/node_modules/
Removing npm-installer/node_modules/
git clean -fdX rubygems/libexec/ rubygems/pkg/
find npm -name 'package.json' -type f -print0 | xargs -0 sed -E -i "s/\"version\": \".+\"/\"version\": \"1.6.10\"/"
sed: 1: "npm/lefthook-linux-x64/ ...": extra characters at the end of n command
make: *** [set-version] Error 1
lefthook/packaging on perf-cli-improvement [?]
❯ |
There is no need to do this for npm-bundled and npm-installer packages because the binaries from these packages are executed directly in a git hook (with full paths). So, only |
@mrexox I'm tried to optimize all of |
@mrexox I am updated PR and now changes affects only |
I understand, but this optimization would work only if you run |
Thank you! I will test the PR later this week 👍 |
Thank you too for your time and looking into this PR |
This should solve few issues related to bun and it has a `bunx`/`npx` support compared to evilmartians#705 This approach does not work on `pnpm` and does not reduce startup time. For `npx` it is faster but not much, for `bunx` it is marginally faster
Closes #703
⚡ Summary
This PR should improve startup performance to get even more out of your performant library
☑️ Checklist