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

Cache Support for Speed #216

Closed
scosman opened this issue Sep 16, 2024 · 3 comments
Closed

Cache Support for Speed #216

scosman opened this issue Sep 16, 2024 · 3 comments

Comments

@scosman
Copy link

scosman commented Sep 16, 2024

Love this action, thanks for making it!

I'm seeing it consistently take 45s, almost all of which is fetching the docker image.

Thoughts on using the cache action to speed things up?

Example log: https://github.com/CriticalMoments/CriticalMoments/actions/runs/10893728646/job/30229199141

@echoix
Copy link

echoix commented Sep 17, 2024

By showing the timestamps on your run, pulling the action+docker images takes between 3-5 seconds, depending on what you consider downloading. (Vs booting or finishing up the pull). A cache wouldn't be faster than pulling a docker container, especially one stored in ghcr.io. Using a GitHub Actions cache, if it was easy to do for docker, would also be slower, since it would need to completely download a single file, then extract that whole file, then load that tar image into docker. Versus with Docker directly, it can download and verify multiple layers in parallel, and start extracting the layers one by one once all the layers above it are done.

So, the vast majority of the time (of the 42 secs total) seems taken by actually linting, so everything seems alright to me.

@scosman
Copy link
Author

scosman commented Sep 17, 2024

Oh! Sorry about the bad report.

The same project takes about 200ms locally for linting+reformatting with clang-format. I'm a bit confused on the 200x slowdown, but will investigate.

@scosman scosman closed this as completed Sep 17, 2024
@echoix
Copy link

echoix commented Sep 17, 2024

This action has or had a problem where it called a docker container for each individual file, instead of passing multiple files at once. So the runtime is way more than it should be.

See #147 for an analysis I did for a my project where this action took 22 minutes, and another clang-format action, wrapped differently, ended up taking 30 seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants