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

Add caching mechanism to speed up loading #86

Merged
merged 3 commits into from
Jan 19, 2024
Merged

Conversation

MHendricks
Copy link
Member

The more distros and configs you have the slower hab becomes. Especially if you have a lot of them on the network. The biggest bottleneck is the globs on windows. There is also likely some slowness for json parsing every file individually.

This saves a cache of the configs and distros on a per-site basis. I the cache exists it is used instead of scanning the file system.

Checklist

  • I have read the CONTRIBUTING.md document
  • I formatted my changes with black
  • I linted my changes with flake8
  • I have added documentation regarding my changes where necessary
  • Any pre-existing tests continue to pass
  • Additional tests were made covering my changes

Types of Changes

  • Bugfix (change that fixes an issue)
  • New Feature (change that adds functionality)
  • Documentation Update (if none of the other choices apply)

Proposed Changes

@MHendricks MHendricks force-pushed the mikeh/site_cache branch 5 times, most recently from 92896fc to d29d82f Compare January 10, 2024 03:02
@MHendricks MHendricks force-pushed the mikeh/site_cache branch 7 times, most recently from 871df2c to 583ac60 Compare January 17, 2024 03:22
@MHendricks MHendricks marked this pull request as ready for review January 17, 2024 03:23
@MHendricks MHendricks force-pushed the mikeh/site_cache branch 3 times, most recently from 48a44fa to 1b4b474 Compare January 19, 2024 20:01
The slowest part of using the hab cli is the globing of config/distro
paths(especially for network paths on windows). Individually parsing
hundreds of json files also is slower than parsing a single json file
containing the same data, which caching helps out with.
@MHendricks MHendricks merged commit 046c7a5 into main Jan 19, 2024
31 checks passed
@MHendricks MHendricks deleted the mikeh/site_cache branch January 19, 2024 23:22
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