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 vDSO when possible. #36358

Closed
dpc opened this issue Sep 9, 2016 · 4 comments
Closed

Use vDSO when possible. #36358

dpc opened this issue Sep 9, 2016 · 4 comments

Comments

@dpc
Copy link
Contributor

dpc commented Sep 9, 2016

I've discovered that Go is using vDSO on Linux to get current time, which makes it much faster. From my initial investigation, it seems Rust is now taking advantage of that yet.

Reference: https://blog.cloudflare.com/its-go-time-on-linux/

@sfackler
Copy link
Member

sfackler commented Sep 9, 2016

We just call into libc, which should route through the vDSO without any manual intervention needed,

If you’re writing your application in a language that uses glibc, you are probably already getting your time via vDSO. Go doesn’t use glibc, so it has to implement this functionality in its runtime.

@dpc
Copy link
Contributor Author

dpc commented Sep 9, 2016

I don't know why, but getting current time in chrono is around 60ns, instead of what's promised for vDSO. I though that maybe two syscalls are being made (current time + current timezone?), and vDSO is not being used. I guess if libc is providing vDSO, then this issue can be closed.

@sfackler
Copy link
Member

sfackler commented Sep 9, 2016

chrono doesn't use the standard library to get the current time, so this issue should be filed on that repo.

@dpc
Copy link
Contributor Author

dpc commented Sep 9, 2016

OH. Good to know. Thank you.

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

No branches or pull requests

2 participants