-
Notifications
You must be signed in to change notification settings - Fork 203
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 improvements for easyconfig parsing and eb startup #3555
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Flamefire
force-pushed
the
perf_improvement
branch
from
January 29, 2021 19:13
5f275b4
to
00e99b7
Compare
boegel
changed the title
Performance improvements for EC parsing
Performance improvements for easyconfig parsing
Feb 3, 2021
Flamefire
force-pushed
the
perf_improvement
branch
3 times, most recently
from
February 4, 2021 09:35
ee89195
to
e8d4e65
Compare
Flamefire
changed the title
Performance improvements for easyconfig parsing
Performance improvements for easyconfig parsing and eb startup
Feb 5, 2021
Flamefire
force-pushed
the
perf_improvement
branch
from
February 5, 2021 09:20
e8d4e65
to
b98dc14
Compare
Prior to this the handle was left open leading to a resource leak As we use this function quite often this can become serious
Prior to this all dependencies were iterated over multiple times with quite expensive handling, e.g. a full copy of the dependencies, list concatenation, and many dict operations Changes: - To avoid the search in the TEMPLATE_SOFTWARE_VERSIONS it is converted to a dict with the key already lowercased (instead of for every dep) - The copy of the dependencies list is done only when required - Dependencies are iterated only once and instead a matching template is searched for which is a lot less work
This avoids raising a traced and hence expensive exception although a more or less common case is fine with "no result" This yields a ~13% speedup in the parsing and sorting of all ECs in the EC unit tests (3m -> 2:30m)
Allow empty PYTHONPATH and non-English LANG/LC_ALL settings by explicitely handling those
The Python docs suggest against the current usage. In profiles it has shown that this is very slow as for every translation request the translation file is searched and an exception thrown as none is found. The change caches the translation which would be (temporarily) created by _gettext (on every call) and reuses it. If none is found a fallback (NullTranslation) is automatically used.
Flamefire
force-pushed
the
perf_improvement
branch
from
April 15, 2021 10:55
dac1e2c
to
75bf03d
Compare
…asyconfig parameter by template_constant_dict function
boegel
approved these changes
May 14, 2021
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.
Thoroughly reviewed, lgtm.
Also tested this a bit in the wild, didn't run into any surprises, so going in.
Thanks a lot @Flamefire, this probably took quite a bit of time to figure out...
34 tasks
migueldiascosta
added a commit
to migueldiascosta/easybuild-framework
that referenced
this pull request
May 27, 2021
…iden '_get_software_root' in fujitsu toolchain
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
With cProfile I identified 2 hotspots:
Toolchain.get_module_version
raisesEasyBuildError
which is a particularly expensive exception due to stack tracing, logging, ... There is a seemingly prominent case where failure is expected. Hence I added a param so None is returned insteadThe other function could be changed too, but it is not required or useful (yet).
My Python also complained about a leaked handle in
run
which might become a problem when it is called often (which we do) leading to anything from nothing over slowdown to crash.