interpreters-comparison icon indicating copy to clipboard operation
interpreters-comparison copied to clipboard

Add guest instruction count statistics collection and display

Open grigory-rechistov opened this issue 8 years ago • 2 comments

Add a mechanism to count how many times each of simulated opcode got executed.

Requirements for a solution

  • It should only be active when INSTR_STAT macro is defined. I.e., it should be conditionally built in.
  • It should maintain an array of counters to keep statistics for individual opcodes. After every instruction is simulated, the corresponding counter should be incremented by one.
  • At the end of simulation, the results table should be produced. It should look like this:
     Opcode    Count
     -------------------
     Nop       1000
     Halt         1
     Push      1234
     ...

  • It can be implemented in a generic manner to support all variants of interpreters

After the implementation is ready, it will be nice to compare performance of two builds - interpreter with stats enabled and disabled, to see the performance overhead such collection creates.

grigory-rechistov avatar Mar 08 '16 21:03 grigory-rechistov

I take it.

lisitsynSA avatar Mar 21 '16 07:03 lisitsynSA

Not done

grigory-rechistov avatar May 23 '16 09:05 grigory-rechistov