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 packed_transaction parsing performance #1025

Closed
heifner opened this issue Apr 13, 2023 · 7 comments · Fixed by #1199
Closed

Improve packed_transaction parsing performance #1025

heifner opened this issue Apr 13, 2023 · 7 comments · Fixed by #1199

Comments

@heifner
Copy link
Member

heifner commented Apr 13, 2023

See #999 (comment)
Simple speedup is to create a caching resolver that caches abis as it goes instead of repeatedly retrieving them.

@greg7mdp
Copy link
Contributor

@heifner in which context can we optimize this. Is it where we parse a single packed_transaction, or do we sometimes parse a bunch of them?

@heifner
Copy link
Member Author

heifner commented Apr 25, 2023

@heifner in which context can we optimize this. Is it where we parse a single packed_transaction, or do we sometimes parse a bunch of them?

The interface for multiple trxs is rarely if ever used. I was thinking of the single packed_transaction use.

@greg7mdp
Copy link
Contributor

Is it likely that we would retrieve the same abi repeatedly for a single transaction?

@heifner
Copy link
Member Author

heifner commented Apr 25, 2023

Is it likely that we would retrieve the same abi repeatedly for a single transaction?

Yes, mining trxs often have many of the same input actions.
For example: https://bloks.io/transaction/c65166655b17ca691c8c46f3baf7c40ef90dde5cda16c2a3cb00a6bc93ca0ce7

@greg7mdp
Copy link
Contributor

Thanks. All clear now!

@greg7mdp greg7mdp self-assigned this May 8, 2023
@greg7mdp greg7mdp added this to the Leap v5.0.0-rc1 milestone May 8, 2023
@greg7mdp
Copy link
Contributor

greg7mdp commented May 8, 2023

@heifner , I'm not seeing where it tries to repeatedly retrieve abis when processing packed transactions?

@heifner
Copy link
Member Author

heifner commented May 8, 2023

@heifner , I'm not seeing where it tries to repeatedly retrieve abis when processing packed transactions?

https://github.com/AntelopeIO/leap/blob/main/plugins/chain_plugin/chain_plugin.cpp#L2189
The resolver created and used there does a find and creates a new abi_serializer for each call to the resolver. It does not cache the abi_serializer.

@greg7mdp greg7mdp moved this from Todo to In Progress in Team Backlog May 8, 2023
@arhag arhag moved this from In Progress to Todo in Team Backlog May 9, 2023
@greg7mdp greg7mdp moved this from Todo to In Progress in Team Backlog May 15, 2023
@BenjaminGormanPMP BenjaminGormanPMP moved this from In Progress to Awaiting Review in Team Backlog May 18, 2023
greg7mdp added a commit that referenced this issue May 19, 2023
Improve packed_transaction parsing performance
@github-project-automation github-project-automation bot moved this from Awaiting Review to Done in Team Backlog May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants