1

What's the best way for profiling the code of an EOS.IO smart contract? I'd like to know what percentage of the CPU time is spent on executing each function\line (including multi index table function calls) within actions.

1 Answer 1

0

Its not possible to check each function/line, but you can test each action. Maybe you could test each function by creating a specific action that calls exactly one line of code/one function each.

When you call an action using cleos, it will tell you on screen how many seconds of CPU time you were charged. For example:

cleos transfer accounta accountb "1 EOS" "memo" 2>&1 | grep "executed transaction" | cut -d' ' -f 8

This will tell you how many microseconds the transaction took

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.