Skip to content

Commit

Permalink
do not measure each instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
pik694 committed Oct 14, 2021
1 parent 636f0e1 commit 4f79b0b
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions core/vm/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,6 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
// explicit STOP, RETURN or SELFDESTRUCT is executed, an error occurred during
// the execution of one of the operations or until the done flag is set by the
// parent context.

in.cfg.Instrumenter.StartTime = runtimeNano()

steps := 0
for {
steps++
Expand Down Expand Up @@ -337,22 +334,6 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
in.returnData = common.CopyBytes(res)
}

// measure the current iteration (we'll deduct StartTime below), this stands for EndTime
in.cfg.Instrumenter.OpCodeDuration = runtimeNano()

// take a new measurement to have the timer overhead (we'll deduct OpCodeDuration/EndTime below),
// this stands for EndTimerTime
in.cfg.Instrumenter.TimerDuration = runtimeNano()
in.cfg.Instrumenter.TimerDuration -= in.cfg.Instrumenter.OpCodeDuration
in.cfg.Instrumenter.OpCodeDuration -= in.cfg.Instrumenter.StartTime

// add to log
in.cfg.Instrumenter.Log = InstrumenterLog{pc, op, in.cfg.Instrumenter.OpCodeDuration, in.cfg.Instrumenter.TimerDuration}
in.cfg.Instrumenter.Logs = append(in.cfg.Instrumenter.Logs, in.cfg.Instrumenter.Log)

// start timing the next iteration
in.cfg.Instrumenter.StartTime = runtimeNano()

switch {
case err != nil:
return nil, err
Expand Down

2 comments on commit 4f79b0b

@pik694
Copy link
Author

@pik694 pik694 commented on 4f79b0b Oct 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pdobacz please take a look here - I'm planning to rebase it onto wallclock once #3 is merged and then rename wallclock into wallclock-all

@pdobacz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pdobacz please take a look here - I'm planning to rebase it onto wallclock once #3 is merged and then rename wallclock into wallclock-all

I forgot about your comment here and found the missing commit the hard way 😅 . I think it's all done now, pls verify

Please sign in to comment.