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

ci(workflow): add cache to workflows using actions/setup-node #9757

Merged
merged 2 commits into from Oct 16, 2021
Merged

ci(workflow): add cache to workflows using actions/setup-node #9757

merged 2 commits into from Oct 16, 2021

Conversation

oscard0m
Copy link
Contributor

Description

Add cache to workflows using actions/setup-node

Context

setup-node GitHub Action just released a new option to add cache to steps using it.

You can find the details here: https://github.blog/changelog/2021-07-02-github-actions-setup-node-now-supports-dependency-caching/


🤖 This PR has been generated automatically by this octoherd script, feel free to run it in your GitHub user/org repositories! 💪🏾

@kurkle
Copy link
Member

kurkle commented Oct 12, 2021

With cache, the use node + install steps were 2 seconds faster in ubuntu and 4 seconds slower in windows.

@kurkle
Copy link
Member

kurkle commented Oct 16, 2021

@etimberg what do you think of this?

It did not look like it speeds anything up, but that is only bases on one run.

Additional changes:
Looks like the intendation change would be correct, but the null and ' => " changes are not.

@oscard0m
Copy link
Contributor Author

With cache, the use node + install steps were 2 seconds faster in ubuntu and 4 seconds slower in windows.

Here you can find some official performance numbers from actions/setup-node team. From what they explain, it depends on the number of dependencies your project has. Less than 10 can be an extra overhead where you don't get benefit and >100 dependencies is when you get a very good benefit apparently.

Checking your package.json you are using around ~50 devDependencies.


For doing the comparison exercise I selected the following Actions: CI executions:

And I'm taking the numbers from Install step which is the one getting benefits from the cache. The rest of steps I think are out of control of this option (if I'm not mistaken):

Ubuntu Windows
Fixed 4 links 39s 58s
ci(workflow): add cache 30s 58s
Difference -23% 0%

Apparently there is no improvement for Windows (but no lost time) and a noticeable improvement for Ubuntu (for the 2 executions of CI I chose).

@kurkle what are the timings you are checking and comparing where there is this 4s slower for Windows and only 2s faster for Ubuntu?

@oscard0m
Copy link
Contributor Author

Additional changes: Looks like the intendation change would be correct, but the null and ' => " changes are not.

Fixing this null + single quotes changes right now :)

@etimberg
Copy link
Member

I'm ok with trying this out to see if it improves things. Agree that the null and quote changes need to be undone before we can merge

@kurkle
Copy link
Member

kurkle commented Oct 16, 2021

@kurkle what are the timings you are checking and comparing where there is this 4s slower for Windows and only 2s faster for Ubuntu?

I compared the runs on this pr, first run had no cache available and I triggered a 2nd run to see if the cache from previous run helps.

These:
https://github.com/chartjs/Chart.js/runs/3875723790?check_suite_focus=true
https://github.com/chartjs/Chart.js/runs/3875789260?check_suite_focus=true

I considered the Use Node.js step too, thats where windows was slower:

image

image

@kurkle kurkle merged commit 12d5e4c into chartjs:master Oct 16, 2021
@oscard0m oscard0m deleted the add-cache-to-node-workflows branch October 16, 2021 19:22
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

Successfully merging this pull request may close these issues.

None yet

3 participants