-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.PerformanceTestingAn issue that has been verified to require only test changes, not just a test failure.An issue that has been verified to require only test changes, not just a test failure.
Milestone
Description
time.Now has a large resolution on Windows, so the benchmark results end up with a timing error.
As a demonstration here's code that measures QueryPerformanceCounter vs. time.Now: https://play.golang.org/p/FN4AtJ9b51m.
f:\Go\src\sandbox\benchmark>go version
go version devel +2bd767b102 Thu Mar 28 09:36:43 2019 +0000 windows/amd64
f:\Go\src\sandbox\benchmark>go run main.go
50% 90% 99%
time.Now Z=9999935 1000000 1005100 1014600
QPC Z=0 100 200 200
Which roughly says that my getting measurements at 1000000ns or 1ms granularity.
Fixing nanotime would be problematic (as seen in #8687), however benchmarks could use QueryPerformanceCounter instead.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.PerformanceTestingAn issue that has been verified to require only test changes, not just a test failure.An issue that has been verified to require only test changes, not just a test failure.