don't call out to prohibitively expensive getRootLoggerName in getLogger, just use 'root' instead #3074
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.
The calls to
getRootLoggerNameare very expensive when__debug__isTrue, since then it relies heavily on Python'sinspectmodule.For some reason unclear to me, the easyconfig tests that run in GitHub CI with Python 3.6 and 3.7 trigger the path that corresponds with
__debug__beingFalse, despite running underpython -O(and also defining$PYTHONOPTIMIZEdoesn't help).Regardless, I think it's fine to strip out the call to
getRootLoggerNameand just use a fixed'root'name instead.For normal use of EasyBuild via the
ebcommand, this doesn't make a difference (since thenpython -Ois used under the covers, and the name of the root logger isn't actually visible anywhere by default unless the%(name)stemplate is used in the log format set viasetLogFormat).This minor change will significantly speed up the easyconfig tests though, when
getRootLoggerNamefollows the path toinspect...