This question already has an answer here:

I am trying to figure out the best ways of benchmarking Solidity contracts. As with normal benchmarking, I presume one would basically want to measure computational effort and storage overhead:

  • gas cost can be used as an easy indicator of computational complexity. Mist & Mix both estimate this before sending a transaction, though this usually differs slightly to the real cost when run (correct?). So you would want to measure both- estimation presumably can be done by importing one of the core platform libraries; real can be tracked via the contract globals.
  • storage overhead would depend on a few things: the compiled bytecode size and size of the contract's storage memory space. The former is again estimated by the tools, the latter I am not so sure how to quantify without reading through the details on how the EVM allocates memory and writing some low-level tool to parse the AST or source and compute the details.

Look forward to seeing if anyone has any pointers on this (:

marked as duplicate by Waqar Lim Jun 14 '16 at 14:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Check out the traceTransaction API - see ethereum.stackexchange.com/questions/4282/…. – Bokky WeAreAllAssange PooBah Jun 13 '16 at 9:20
  • 1
    beautiful! Lots of useful methods in there. If you repost as an answer I can mark it accepted (; – pospi Jun 14 '16 at 0:27
  • Linked the both questions since it seems it was what you were looking for. If not, edit your question and request a reopening. – Waqar Lim Jun 14 '16 at 14:03