Skip to content

Comments

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

Merged
aminya merged 1 commit intomasterfrom
setup-python-bundle
Sep 8, 2023
Merged

perf: add dynamically loaded cache-dependencies for actions python#199
aminya merged 1 commit intomasterfrom
setup-python-bundle

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