Skip to content
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

use monotonic clock instead of system clock #14

Closed
wants to merge 2 commits into from

Conversation

bergey
Copy link

@bergey bergey commented Dec 20, 2019

closes #13

@bergey
Copy link
Author

bergey commented Dec 20, 2019

After benchmarking this change, I'm not sure I can recommend it. I'm seeing 2.5 times as much overhead from this version as from the system clock version in master. On my recent Macbook Pro, I see 400us median overhead on master, 1000us on this branch, and 800us if I use the monotonic clock but convert directly to Double without Rational . Those seem like overheads that might concern some users of this library. What do you think?

@domenkozar
Copy link

How about using https://hackage.haskell.org/package/base-4.12.0.0/docs/GHC-Clock.html#v:getMonotonicTimeNSec that should be significantly faster?

@bergey
Copy link
Author

bergey commented Feb 17, 2021

@domenkozar Indeed, GHC.Clock works much better. Thanks! Closing in favor of #25

@bergey bergey closed this Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use monotonic clock instead of system clock
2 participants