-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime: use clock_gettime instead of gettimeofday on Darwin #25633
Comments
Change https://golang.org/cl/161721 mentions this issue: |
Updates golang/go#25633 Change-Id: I20ff2d0cda642fb7b155d3ae06499e8c0ef0a2b2 Reviewed-on: https://go-review.googlesource.com/c/161721 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Go 1.13 requires Darwin 1.11 or newer. Getting closer... |
Go 1.15 will require 10.12. Setting that milestone. |
Change https://golang.org/cl/270918 mentions this issue: |
@tklauser, any positive performance improvements as a result of this? I seem to recall another bug where getting the time on macOS was really slow for some reason. |
@bradfitz I didn't see any performance improvements. The benchmarks seem more or less unchanged (macOS 10.15 on 1.6 GHz Dual-Core Intel Core i5):
Results seems to be a bit inconsistent though, for some runs I also got slightly increased numbers (around +2%). |
clock_gettime has higher resolution, we should use it if available.
It is not guaranteed to be available until Darwin 10.12. This issue is on hold until that is our minimum Darwin version.
We could do this now but it would require making the choice at runtime. That seems difficult - we'd need to use the Darwin equivalent of dlopen/dlsym to query the existence of, and call, clock_gettime.
The text was updated successfully, but these errors were encountered: