TransWikia.com

Profiling EOS.IO smart contract code

EOS.IO Asked by Yogev Mashiach on August 11, 2020

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 functionline (including multi index table function calls) within actions.

One Answer

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

Answered by Phillip Hamnett - EOS42 on August 11, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP