Is there a way to count the number of IL instructions executed?

后端 未结 5 621
萌比男神i
萌比男神i 2021-01-06 06:19

I want to do some benchmarking of a C# process, but I don\'t want to use time as my vector - I want to count the number of IL instructions that get executed in a particular

5条回答
  •  醉酒成梦
    2021-01-06 07:14

    I know you don't want the static count. However, the static IL count per arc, plus the number of times the arc was executed together give you the IL count. You'd need to instrument each arc for this, which requires inserting a counter.

    (An arc is a sequence of instructions which you can't jump in or out. If you execute the first instruction, you'll always execute the last, etc.)

提交回复
热议问题