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

eos_vm 7% perf improvement by optimizing the expensive get_imported_functions_size function. #28

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

greg7mdp
Copy link
Contributor

@greg7mdp greg7mdp commented Oct 23, 2024

This improves the performance of eos-vm by about 7% (reduces total time from 6.8% to 1.55%, however the time spent in execute is 75% of the total execution time for api_part2_tests).

Running the perf tool, I noticed that get_imported_functions_size was one of the top cpu users. Most of the time is spent calling size() and doing an unnecessary check (that _index, the i in the loop, is less than size()).

This streamlines the code.

pre optimization:

pre_optim

post optimization:

post_optim

Also fixes an incorrect std::forward use, of no consequense since the forwarded data has no pointers and is moved anyways.

@greg7mdp greg7mdp changed the title Optimize expensive get_imported_functions_size function. eos_vm 7% perf improvement by optimizing the expensive get_imported_functions_size function. Oct 23, 2024
@greg7mdp greg7mdp merged commit ef84752 into main Oct 23, 2024
10 checks passed
@greg7mdp greg7mdp deleted the eos_vm_perf branch October 23, 2024 17:41
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

Successfully merging this pull request may close these issues.

3 participants