-
Notifications
You must be signed in to change notification settings - Fork 63
feat: reduce localnet start/reset time #702
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
base: main
Are you sure you want to change the base?
Conversation
lempira
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement!
It looks like localnet --update will override the image cache and pull the lates but there doesn't seem to be a way to check if the cache is outdated within the TTL (a week). What about adding another localnet command like algokit localnet check that will just run the check and compare it against the cache? Alternatively, there could be a --check flag that will perform the check on that command. So algokit localnet start --check will start localnet but warn if there are new images. It would also work on localnet status --check
@lempira Good idea, will add that now. |
592ea1a to
0f6183a
Compare
Each time LocalNet is started or reset, a number of http calls would be made to the docker hub to check if any new docker image versions are available. New versions are generally released infrequently, so most of the time this check is not needed and slows the start/reset time of LocalNet.
This PR reduces the frequency of calls to check for new docker image versions, so that start/reset time is faster.
Based on some rudimentary tests, the following results were observed:
Starting without existing containers -
algokit localnet startBaseline: 10.51s (average)
Without version check: 7.82s (average)
≈ 25% improvement
Starting with existing containers -
algokit localnet startBaseline: 3.767s (average)
Without version check: 1.845s (average)
≈ 51% improvement
Resetting -
algokit localnet resetBaseline: 13.674s (average)
Without version check: 11.304s (average)
≈ 17% improvement