Skip to content
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

npx @action-validator/cli is really slow compared to calling the binary directly #220

Closed
deviantintegral opened this issue Jun 29, 2023 · 2 comments · Fixed by #676
Closed
Assignees
Labels
bug Something isn't working

Comments

@deviantintegral
Copy link
Member

deviantintegral commented Jun 29, 2023

I noticed that the validator action is pretty slow. Here's examples from a repository with 34 files:

$ time (find . -name '*yml' | xargs -n1 npx @action-validator/cli)

real	2m17.317s
user	1m11.874s
sys	0m13.308s

Calling the script directly (which is rust, so relatively fast!):

$ time (find . -name '*yml' | xargs -n1 /mnt/ddev-global-cache/npm/_npx/7a1a696535fd56d2/node_modules/.bin/action-validator)

real	0m3.905s
user	0m6.540s
sys	0m1.423s

So, 2m14s of overhead just in spinning up nodejs and calling the script!

Since this is available as a single binary, I think we should download the binary directly, likely how we will do soon with task and local-security-checker.

@deviantintegral
Copy link
Member Author

Here's the Dockerfile lines I used to bring this into a project.

# Install action-validator for GitHub actions linting.
RUN /bin/bash -c '([[ $(arch) == "aarch64" ]] && curl -Lo /usr/local/bin/action-validator https://github.com/mpalmer/action-validator/releases/download/v0.5.2/action-validator_linux_arm64) || true'
RUN /bin/bash -c '([[ $(arch) == "x86_64" ]] && curl -Lo /usr/local/bin/action-validator https://github.com/mpalmer/action-validator/releases/download/v0.5.2/action-validator_linux_amd64) || true'
RUN chmod +x /usr/local/bin/action-validator

@deviantintegral deviantintegral added the bug Something isn't working label Feb 19, 2024
@deviantintegral
Copy link
Member Author

I've marked this as high priority since we're talking about a 35x slowdown for real-world projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants