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

Performance on Linux - Profile loaded every time #16

Closed
julien040 opened this issue Feb 26, 2023 · 0 comments · Fixed by #18
Closed

Performance on Linux - Profile loaded every time #16

julien040 opened this issue Feb 26, 2023 · 0 comments · Fixed by #18
Assignees
Labels
performance Improve performance of a feature

Comments

@julien040
Copy link
Owner

On every commands, the init() function in profile package is called.
On Linux, it runs a bunch of checks (GUI available, pass is installed, etc.).
But these check aren't required on every commands (gut status for instance).

Solution

The init function must only be called when needed (a profile is required).

@julien040 julien040 self-assigned this Feb 26, 2023
@julien040 julien040 added the performance Improve performance of a feature label Feb 26, 2023
@julien040 julien040 linked a pull request Feb 26, 2023 that will close this issue
julien040 added a commit that referenced this issue Feb 26, 2023
Changes in profiles loading
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.
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.

Commits:
* 🩹 Remove debug print in profile
On Linux, gut search for the path of Xorg to check if a GUI is available
If it returns an error, this means no GUI is available.
But this error must not be printed. It's only used to find out if a GUI is available

* ⚡️ Remove loading of profiles in every command
There is a lot of commands that doesn't require to load profiles
But because of how "init()" works, gut was loading every profiles and password before running the command.
This led to performance issues on Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Improve performance of a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant