Created
February 24, 2017 03:05
-
-
Save ahh/1d62771bd9e04a41bac25e3ea523615d to your computer and use it in GitHub Desktop.
Bad view benchmark with timing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int64_t before = rdtsc(); | |
SpawnNThreadsRunning(15, [&shared]() { | |
for (int i = 0; i < reps; ++i) { | |
auto snapshot = shared.Get(); | |
// ... do some meaningless work... | |
} | |
}); | |
for (int i = 0; i < reps; ++i) { | |
auto snapshot = shared.Get(); | |
// ... do some meaningless work... | |
} | |
WaitForThreads(); | |
int64_t after = rdtsc(); | |
ReportCycles(after - before); | |
BENCHMARK(BM_View)->Threads(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment