Skip to content

Commit

Permalink
i#6971 sched time: Reduce gettimeofday calls (#6972)
Browse files Browse the repository at this point in the history
Only call gettimeofday once per next_record for instruction quanta,
rather than every get_output_time() call.

Future work will try to revisit using a counter to eliminate the
non-determinism of wall-clock time and make analyzers behavior more like
simulators, easing testing.

Issue: #6971
  • Loading branch information
derekbruening authored Sep 10, 2024
1 parent ae6765c commit 02c1430
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions clients/drcachesim/scheduler/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2337,11 +2337,7 @@ template <typename RecordType, typename ReaderType>
uint64_t
scheduler_tmpl_t<RecordType, ReaderType>::get_output_time(output_ordinal_t output)
{
// If the user is giving us times take the most recent of those.
if (outputs_[output].cur_time > 0)
return outputs_[output].cur_time;
// Otherwise, use wall-clock time.
return get_time_micros();
return outputs_[output].cur_time;
}

template <typename RecordType, typename ReaderType>
Expand Down

0 comments on commit 02c1430

Please sign in to comment.