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

time: Improve Instant::now() perf with test-util #5513

Merged
merged 4 commits into from
Feb 27, 2023

Commits on Feb 27, 2023

  1. time: Improve Instant::now() perf with test-util

    The test-util feature flag is only intended to be use with tests.
    However, it is possible to accidentally enable it in release mode. This
    patch reduces the overhead of `Instant::now()` when the `test-util`
    feature flag is enabled but `time::pause()` is not called.
    
    The optimization is implemented by adding a static atomic flag that
    tracks if `time::pause()` has ever been called. In `Instant::now()`, the
    atomic flag is first checked before the thread-local and mutex are
    accessed.
    carllerche committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    3bdc10c View commit details
    Browse the repository at this point in the history
  2. Fix CI

    carllerche committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    729215b View commit details
    Browse the repository at this point in the history
  3. add test for start_paused

    carllerche committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    ea47fec View commit details
    Browse the repository at this point in the history
  4. fmt

    carllerche committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    19d75aa View commit details
    Browse the repository at this point in the history