Commit 8222074e authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

[WaitableEvent] Back to nanoseconds for the perf tests

In a recent refactoring we opted to switch to microseconds because
that's TimeDelta's finest resolution but results are now 0 or 1 us
always and it makes the dashboard useless.

I think it's okay to yield results in nanoseconds because it's an
effective average of 0-1 us samples.

The common perf test solution to this is to measure a batch of, e.g.,
1000 calls but this is tricky with WaitableEvent because we want to
measure Signal/Wait() from multiple threads but not the dead time in
between.

R=kylechar@chromium.org, skyostil@chromium.org

Bug: 905412
Change-Id: I30daf41535d36ff59b19a64523f0a558c3fa1b2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1724699
Commit-Queue: Gabriel Charette <gab@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681871}
parent 1dbdc09b
......@@ -94,15 +94,15 @@ class SignalerThread : public SimpleThread {
void PrintPerfWaitableEvent(const TraceWaitableEvent* event,
const std::string& trace) {
perf_test::PrintResult(
"WaitableEvent_SignalTime", "", trace,
static_cast<size_t>(event->total_signal_time().InMicroseconds()) /
"WaitableEvent_SignalTime_ns", "", trace,
static_cast<size_t>(event->total_signal_time().InNanoseconds()) /
event->signal_samples(),
"us/sample", true);
"ns/sample", true);
perf_test::PrintResult(
"WaitableEvent_WaitTime", "", trace,
static_cast<size_t>(event->total_wait_time().InMicroseconds()) /
"WaitableEvent_WaitTime_ns", "", trace,
static_cast<size_t>(event->total_wait_time().InNanoseconds()) /
event->wait_samples(),
"us/sample", true);
"ns/sample", true);
}
} // namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment