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

maint: Replace usage of folly in clock.hpp #1448

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

jjerphan
Copy link
Collaborator

@jjerphan jjerphan commented Mar 20, 2024

Reference Issues/PRs

Part of #1412.

What does this implement or fix?

folly::chrono::clock_gettime_ns's definition uses the vDSO on Linux (calling the vDSO is not considered a good practice (see the "Description" section of vdso(7)'s man page). Alternatively, it calls clock_gettime.

std::chrono::system_clock::now has nanosecond precision. and also calls clock_gettime with CLOCK_REALTIME. libstdc++ does not use CLOCK_REALTIME_COARSE at all..

Hence, the only drawback is that coarse_nanos_since_epoch who used to return coarse precision timestamp (see CLOCK_REALTIME_COARSE) now returns an accurate timestamp. Must we keep coarse precision or not?

Any other comments?

Checklist

Checklist for code changes...
  • Have you updated the relevant docstrings, documentation and copyright notice?
  • Is this contribution tested against all ArcticDB's features?
  • Do all exceptions introduced raise appropriate error messages?
  • Are API changes highlighted in the PR description?
  • Is the PR labelled as enhancement or bug so it appears in autogenerated release notes?

@jjerphan jjerphan mentioned this pull request Mar 20, 2024
17 tasks
@jjerphan jjerphan marked this pull request as ready for review March 20, 2024 16:42
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is is possible to check if the resolution of the clock is the same?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both have nanoseconds resolution seemingly calling clock_gettime.

Copy link
Collaborator Author

@jjerphan jjerphan Mar 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

folly::chrono::clock_gettime_ns's definition uses the vDSO on Linux (calling the vDSO is not considered a good practice (see the "Description" section of vdso(7)'s man page). Alternatively, it calls clock_gettime.

std::chrono::system_clock::now has nanosecond precision. and also calls clock_gettime with CLOCK_REALTIME.

The only drawback is that coarse_nanos_since_epoch who used to return coarse precision timestamp (see CLOCK_REALTIME_COARSE) now returns an accurate timestamp. Must we refine it or not?

@jjerphan jjerphan force-pushed the maint/replace-folly-usage-in-clock.hpp branch 2 times, most recently from 0785fd2 to 12d7671 Compare April 17, 2024 11:20
Signed-off-by: Julien Jerphanion <[email protected]>

Co-authored-by: William Dealtry <[email protected]>
@jjerphan
Copy link
Collaborator Author

@jjerphan jjerphan merged commit 8cb133f into master Apr 25, 2024
114 checks passed
@jjerphan jjerphan deleted the maint/replace-folly-usage-in-clock.hpp branch April 25, 2024 05:48
grusev pushed a commit that referenced this pull request Nov 25, 2024
Signed-off-by: Julien Jerphanion <[email protected]>
Co-authored-by: William Dealtry <[email protected]>
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.

4 participants