Fix #16 - Improving performance of profiles loading #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request improves performance of gut.
Rather than loading all profiles on each launch, gut will load them only if the command requires it.
For example,
status
doesn't need to load any profiles. Before this pull request, gut would load all profiles even if it's not needed.Changes done
To stop this behaviour, the ˋinit` function in the ˋprofileˋ package has been renamed.
This new function is now called on top of every exported functions of the package so that profiles are loaded when needed.
Note : the function won't run twice thanks to a global boolean variable.
Performance improvement over commands that doesn't require any profiles
This test not scientific at all has been run on Fedora on a DO 512MB ram VPS.