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

perf: add dynamically loaded cache-dependencies for actions python #199

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

aminya
Copy link
Owner

@aminya aminya commented Sep 8, 2023

This reduces the main bundle size by ⚠️ 1.28 MB minified! This bundle is loaded only when caching is enabled.

setup-python is used in setup-cpp as a library. This optimization reduces the bundle size for that package as well. The build system of setup-python uses ncc, which doesn't immediately benefit from this change, but setup-cpp uses Parcel, which shows this huge improvement.

The reason for this huge reduction is that caching the dependencies uses the @actions/cache package, which is an extremely large package with big dependencies. The bundle size before this separation shows this: Screenshot_20230907_230625

actions/setup-python#728

This reduces the main bundle size by ⚠️  1.28 MB minified! This bundle is loaded only when caching is enabled.

`setup-python` is used in [`setup-cpp`](https://github.com/aminya/setup-cpp) as a library. This optimization reduces the bundle size for that package as well. The build system of `setup-python` uses `ncc`, which doesn't immediately benefit from this change, but setup-cpp uses `Parcel`, which shows this huge improvement.

The reason for this huge reduction is that caching the dependencies uses the `@actions/cache` package, which is an extremely large package with big dependencies. The bundle size before this separation shows this:
![Screenshot_20230907_230625](https://github.com/actions/setup-python/assets/16418197/ec1baf34-85c3-459d-b8cf-894899959b2c)
@aminya aminya force-pushed the setup-python-bundle branch from d8ed5b1 to 96396ce Compare September 8, 2023 06:21
@aminya aminya merged commit 4ca8d58 into master Sep 8, 2023
@aminya aminya deleted the setup-python-bundle branch January 22, 2024 10:23
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.

1 participant