I am trying to generate the bytecode for a single function. I need to avoid any setup/teardown that may occur in the contract as I am trying to get a precise measurement of the execution time in the EVM.

Is there anyway to compile solely a function (ie. no contract) or is there maybe someway to deduce the entry point from the ABI?


The execution time is instantaneous regardless of complexity.

The actual time is about waiting for the transaction to be mined and being informed that the transaction was mined.

Before being mined, it is in a pending state with no assurance it will happen at all. After it is mined, it has already occurred in the past and the results are facts on the blockchain.

There is no notion of execution time as you would consider it in a conventional processor.

Hope it helps.

  • The execution time is not instantaneous, every opcode uses some cpu time to execute. Yes this may not be relevant to most people but for EVM development it certainly is (although far from being a bottleneck in the system). In my case I am benchmarking a solidity implementation against an opcode implementation of the same functionality – DAnsermino Jun 13 '18 at 19:14
  • Ha ha, yeah. I realize there is no free lunch. Possibly I understood a different question than you have in mind. From the perspective of a contract running on the EVM, regular ideas of execution time don't make sense. The performance metric is gas. – Rob Hitchens Jun 13 '18 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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