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

Do not recurse into ignored directories. #294

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

armooo
Copy link
Contributor

@armooo armooo commented Feb 28, 2025

When generating the tar.gz for local previews can skip recursively processing them. This potentially saves a lot of processing time by removing the stat calls to the files contained in them. This tends to be the case for node_modules and other commonly ignored paths.

On my internal git repo running on macos this results in a -82% change to the time to generate the tar.tz.

$ time spacectl stack local-preview --id test  --no-upload
151.33 secs

$ time ~/src/spacectl/spacectl stack local-preview --id test  --no-upload
26.32 secs

I also checked if the same files were included in both tar.gz files.

$ tar -tf ~/old.tar.gz | sed 's|[^/]*||' | shasum
82510ad099d3eb9e3c1bba906b8b8dff00c802aa  -

$ tar -tf ~/new.tar.gz | sed 's|[^/]*||' | shasum
82510ad099d3eb9e3c1bba906b8b8dff00c802aa  -

Fixes: #289

When generating the tar.gz for local previews can skip recursively
processing them. This potentially saves a lot of processing time by
removing the stat calls to the files contained in them. This tends to be
the case for node_modules and other commonly ignored paths.

On my internal git repo running on macos this results in a -82% change
into the to generate the tar.tz.
```
$ time spacectl stack local-preview --id test  --no-upload
151.33 secs

$ time ~/src/spacectl/spacectl stack local-preview --id test  --no-upload
26.32 secs
```

I also checked if the same files were included in both tar.gz files.
```
$ tar -tf ~/old.tar.gz | sed 's|[^/]*||' | shasum
82510ad099d3eb9e3c1bba906b8b8dff00c802aa  -

$ tar -tf ~/new.tar.gz | sed 's|[^/]*||' | shasum
82510ad099d3eb9e3c1bba906b8b8dff00c802aa  -
```
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.

Stack local preview is slow in large working trees.
1 participant