-
Notifications
You must be signed in to change notification settings - Fork 36
Use Stopwatch.GetTimestamp on MacOS #540
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
Conversation
On linux gettimeofday is likely fastest (and is a portable POSIX1 call): Can this be p/invoked on linux? Second answer here suggests it will also work on OSX: P/Invoke docs: |
There is a repeatable very slight gain, but it is close to noise.
LRU bench (with fix)
v2.5.0 baseline
|
Stopwatch.GetTimestamp
is slightly faster thanEnvironment.TickCount64
on MacOS, therefore use the faster implementation to get a small optimization.This is the time benchmark result from Github actions running on MacOS:
This is the GetOrAdd bench (baseline v2.5.0):