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

Base58 while loop eats up CPU #28

Closed
pragmaxim opened this issue Jun 16, 2023 · 2 comments
Closed

Base58 while loop eats up CPU #28

pragmaxim opened this issue Jun 16, 2023 · 2 comments

Comments

@pragmaxim
Copy link

pragmaxim commented Jun 16, 2023

It eats up almost 30% of the runtime, taking more time than indexing blocks into database. Completely different implementation com.google.bitcoin.core.Base58 eats up only 7%.

https://github.com/ScorexFoundation/scorex-util/blob/master/shared/src/main/scala/scorex/util/encode/Base58.scala#L22C1-L26

Screenshot from 2023-06-16 10-51-14

Ping #27

@pragmaxim
Copy link
Author

Ok, this implementation of Base58 is extremely slow, com.google.bitcoin.core.Base58 is ~ 3-4 times faster ... After some further optimizations of blockchain explorer indexing, ~ 45% goes to com.google.bitcoin.core.Base58, 15% goes to sigma and 40% to the rest.
Screenshot from 2023-06-20 15-22-24

@aslesarenko
Copy link
Collaborator

Thanks for the flame graphs. This is known issue #21, closing this as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants