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

Switch to api.ast.json.gz instead of api.ast.json #441

Merged
merged 1 commit into from
Mar 10, 2023

Conversation

ohodson
Copy link
Contributor

@ohodson ohodson commented Mar 10, 2023

api.ast.json consumes 2.5GB in the output directory, compressing it saves 2.4GB of storage. The saving is useful in devhouse and for github actions (linux SSD size 14GB).

Test: build bazel //... && bazel test //...

@ohodson ohodson requested a review from penalosa March 10, 2023 13:50
@ohodson
Copy link
Contributor Author

ohodson commented Mar 10, 2023

Hi Somhairle, I'm seeing out of disk space problems in the GitHub runners trying to update v8 in workerd (#437). This saves a couple of GB disk space and might open a path forward for the v8 update. PTAL, thanks!

@fhanau
Copy link
Collaborator

fhanau commented Mar 10, 2023

As far as I can see the AST is only used when generating the JSON types here – that code wouldn't support gzipped inputs out of the box, right?

@fhanau
Copy link
Collaborator

fhanau commented Mar 10, 2023

Never mind, just noticed you're adding ungzip support in param-extractor.rs and the input for the TypeScript code itself is uncompressed

@ohodson
Copy link
Contributor Author

ohodson commented Mar 10, 2023

Hi Felix, thanks for looking into the change. You're right: we're just compressing the one file and adding support for decompressing it when it is consumed. With this patch:

$ du -hs ~/bazel_disk_cache/ ~/.cache/bazel
6.8G    /home/orion/bazel_disk_cache/
11G     /home/orion/.cache/bazel

Previously:

$ du -hs ~/bazel_disk_cache/ ~/.cache/bazel
9.1G    /home/orion/bazel_disk_cache/
13G     /home/orion/.cache/bazel

@fhanau
Copy link
Collaborator

fhanau commented Mar 10, 2023

LGTM overall. The only possible downside I can think of is the time spent on compression – the default, unoptimized gzip can be quite slow. It looks like there is no big impact on the CI build time here, but have you tried what impact e.g.gzip -3 would have?

@ohodson
Copy link
Contributor Author

ohodson commented Mar 10, 2023

-3 reduces the compression time here from 20s to 13s and increases file size (140MB vs 100MB).

api.ast.json consumes 2.5GB in the output directory, compressing it
saves 2.4GB of storage. The saving is useful in devhouse and for
github actions (linux SSD size 14GB).

Test: build bazel //... && bazel test //...
@ohodson
Copy link
Contributor Author

ohodson commented Mar 10, 2023

The latest update has "gzip -3", it seems like a good trade-off and we still have a massive large size saving. Thanks! 373a11b

@ohodson ohodson merged commit 28cf42f into main Mar 10, 2023
@ohodson ohodson deleted the orion-compress-api-json branch March 10, 2023 17:53
@penalosa
Copy link
Collaborator

Thanks for this @ohodson! I'll have a check over the output later today (I'm not super sure whether the type parsing tests cover parameter extraction)

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.

3 participants