-
Notifications
You must be signed in to change notification settings - Fork 803
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
refactor: reduce and simplify usage of getEnv() #4799
refactor: reduce and simplify usage of getEnv() #4799
Conversation
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.
Thanks. This is more readable now 👍
FYI performance-wise this would not change a lot since all the changed functions are not called on a hot path (only once on start-up).
Please also add a changelog entry to the unrelased section, subsection enhancement in |
Updated @pichlermarc 👍 |
* refactor: reduce and simplify usage of getEnv() * docs: update CHANGELOG * fixup! docs: update CHANGELOG --------- Co-authored-by: Marc Pichler <[email protected]>
In most of the exporters, there is a function
getEnv()
that is called an unnecessary amount of times inside nested ternary operators.It looks as
getEnv()
callsparseEnvironment()
that happens to iterate over a large static object parsing its values and performing other assertions.See extract from source:
This PR reduces the total invocations of
getEnv
along the exporters in the hope of easing performance and readability.