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

Implement version_clean & check_extra_requirements in opkg module #50938

Conversation

andzn
Copy link
Contributor

@andzn andzn commented Dec 20, 2018

What does this PR do?

Implement pkg.version_clean & pkg.check_extra_requirements in the opkg execution module

Previous Behavior

The time it took to apply a state that contained many (in our case ~400) of packages, when all of the packages were installed was ~11 minutes.
The package state module checks if the pkg module has defined the version_clean and check_extra_requirements_functions in a for loop that iterates through all the packages. Therefore, if the two functions are not defined, the lazy loader will always fail, leading to poor performance.
An alternative would be to cache the function before entering the for loop but that is a little bit trickier to do since, the actual call to version_clean & check_extra_requirements functions are done via a different execution module called pkg_resource. We would not want to cache pkg_resource.version_clean, as that one will always exist. We would want to cache pkg.version_clean because that one might not exist for every 'pkg' module.

New Behavior

The time it takes to apply a state that contains many (in our case ~400) of packages, when all of the packages are installed is 9 seconds.

Tests written?

No

Commits signed with GPG?

No

Copy link
Contributor

@dwoz dwoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andzn Nice find and great ticket description. Thanks!

@garethgreenaway garethgreenaway merged commit d86bfc0 into saltstack:develop Jan 3, 2019
garethgreenaway added a commit to garethgreenaway/salt that referenced this pull request Dec 3, 2019
dwoz added a commit that referenced this pull request Dec 29, 2019
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.

3 participants