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

TRAP Caching: Skip uploading of small caches #1265

Merged
merged 1 commit into from
Sep 23, 2022

Conversation

edoardopirovano
Copy link
Contributor

@edoardopirovano edoardopirovano commented Sep 23, 2022

Our telemetry shows that in a fair amount of cases we get some very small TRAP caches because the repository contains only a very small cacheable amount of the language being analyzed. In this case, we get slight performance regressions because the extra network calls just aren't worth doing for so little information. Let's set a minimum size of cache that we will consider worth uploading, so that we don't waste time uploading (and then redownloading) caches that are just too small to be worth it.

Empirically, 10MB is a good threshold for this because it is around 2MB more than the size of the TRAP for the JavaScript standard library, so this represents us actually caching some useful things beyond this. Other languages might have a different threshold for what is considered a big enough cache to be useful - we can explore that further (guided by our telemetry) once we get to implementing this feature for other languages.

There'll still be some small caches in the internal repos that had the feature flag on, but these should disappear on their own after around a week since that's the retention time of the GitHub Actions cache.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

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

Seems sensible. I think this could warrant a changenote.

src/util.ts Outdated Show resolved Hide resolved
@edoardopirovano
Copy link
Contributor Author

Seems sensible. I think this could warrant a changenote.

Since we haven't enabled this feature yet for any external users, nor made any promises about the specifics of its behaviour, I think it's reasonable to put in a change like this without another change note. Happy to add one if you disagree, though.

Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

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

Since we haven't enabled this feature yet for any external users, nor made any promises about the specifics of its behaviour, I think it's reasonable to put in a change like this without another change note.

👍

@edoardopirovano edoardopirovano merged commit 4c8f137 into main Sep 23, 2022
@edoardopirovano edoardopirovano deleted the edoardo/minimum-cache-size branch September 23, 2022 14:49
@edoardopirovano edoardopirovano mentioned this pull request Sep 23, 2022
3 tasks
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

2 participants