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:
post optimization:
Also fixes an incorrect std::forward use, of no consequense since the forwarded data has no pointers and is moved anyways.
This improves the performance of
eos-vm
by about 7% (reduces total time from 6.8% to 1.55%, however the time spent inexecute
is 75% of the total execution time forapi_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 callingsize()
and doing an unnecessary check (that_index
, thei
in the loop, is less than size()).This streamlines the code.
pre optimization:
post optimization:
Also fixes an incorrect
std::forward
use, of no consequense since the forwarded data has no pointers and is moved anyways.