-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Cache results of isFiatCurrency and isCryptoCurrency #4955
Cache results of isFiatCurrency and isCryptoCurrency #4955
Conversation
They are called very often and accumulate cpu time as shown in profilers.
I'm a little surprised there's much speedup, since the methods |
Thanks @stejbac for the review and comments! I just did some measurments: With wrong Fiat, wrong crypto
With correct Fiat and crypto
With correct Fiat and crypto using concurrentHashMap in CurrencyUtil2
It seems the Currency.getInstance(currencyCode) is the "expensive" one. |
Add comment
Yes, I think I recall the methods being a significant hotspot, when profiling the UI a while ago, so even small absolute speedups are probably worthwhile. The updated changes in the PR look fine to me. utACK |
Yes, they are relatively easy and low risk, thats why I started on that beside other more complex ones like in the DAO domain... |
@chimp1984 tests are failing. |
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.
utACK on the changes
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.
utACK
No description provided.