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

Improve performance of sdk.Dec ImmutOpInt64 by avoiding newint #11166

Closed
4 tasks
sunnya97 opened this issue Feb 11, 2022 · 4 comments
Closed
4 tasks

Improve performance of sdk.Dec ImmutOpInt64 by avoiding newint #11166

sunnya97 opened this issue Feb 11, 2022 · 4 comments
Labels
C:Types T: Performance Performance improvements

Comments

@sunnya97
Copy link
Member

Based on @ValarDragon TODO from #11004:

We should use the already allocated operand bigint to avoid newint each time. Need to add a mutex for race conditions.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@sunnya97 sunnya97 added T: Performance Performance improvements C:Types labels Feb 11, 2022
@elias-orijtech
Copy link
Contributor

Shared state protected by a mutex is a heavy weight optimization. Is this issue only based on a TODO or is there evidence Dec.ImmutOpInt64 is performance sensitive in realistic workloads?

@ValarDragon
Copy link
Contributor

Unclear if the mutex would be faster, but in Osmosis we do a lot of ~all decimal math operations.

E.g. this one is used in exponentiation math, which we do a lot of

@elias-orijtech
Copy link
Contributor

Ok, it sounds like we should wait for a benchmark that clearly shows the performance hit solved by optimizing ImmutOpInt64, correct? If so, I'm inclined to close this as won't fix and leave the TODO in code. Let me know if closing this kind of issue is inappropriate.

@ValarDragon
Copy link
Contributor

This sounds good to me

@tac0turtle tac0turtle closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Types T: Performance Performance improvements
Projects
No open projects
Development

No branches or pull requests

4 participants