GithubHelp home page GithubHelp logo

clocksource's People

Contributors

brayniac avatar friedroman avatar goirad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

clocksource's Issues

Release Request

Would it be possible to have a new release of clocksource?

possible to convert these clock readings to a time?

hey -

Perhaps this should be obvious but to me it is not. How can I convert these clock readings to represent the number of nanoseconds since 1970? Is that possible? Perhaps they are only for timing things but would be nice to get a more precise and fast time out of it as part of the same deal.

Thanks!

Swapping in clocks calibrated off thread

hey,

I spent a couple hours tonight trying to work up a struct interface to a thread that periodically calibrates a Clocksource and sends clones around to any subscribing threads. However, I was surprised to find that neither of two approaches I tried ended up being faster than calling std::time::SystemTime::now(). It seems that the overhead of concurrency is more costly than the marginal speedup of rdtsc.

This branch has the code. Would be interested in any thoughts you have. Happy to eventually submit as a pull request if you'd like but figured I would check in first since 1) it didn't work quite as expected, 2) no idea if you want something like this in the library.

Here are some bench results:

i7 laptop:

$ RUSTFLAGS="-C target-cpu=native" cargo bench
# ...
running 11 tests
test tests::test_raw ... ignored
test tests::test_reference ... ignored
test tests::test_source ... ignored
test calibrator::tests::calibrates_a_realtime_counter_clocksource       ... ignored
test calibrator::tests::cloning_a_clocksource                           ... bench:           1 ns/iter (+/- 0)
test calibrator::tests::mpsc_calibrator_hot_path_loop_overhead          ... bench:          28 ns/iter (+/- 1)
test calibrator::tests::triple_buffer_calibrator_hot_path_loop_overhead ... bench:          28 ns/iter (+/- 3)
test tests::calls_rdtsc_directly                                        ... bench:          11 ns/iter (+/- 0)
test tests::calls_std_instant_now                                       ... bench:          20 ns/iter (+/- 1)
test tests::calls_std_system_time_now                                   ... bench:          20 ns/iter (+/- 0)
test tests::it_creates_a_duration                                       ... bench:           1 ns/iter (+/- 0)

xeon server:

$ RUSTFLAGS="-C target-cpu=native" cargo bench
# ...
running 11 tests
test tests::test_raw ... ignored
test tests::test_reference ... ignored
test tests::test_source ... ignored
test calibrator::tests::calibrates_a_realtime_counter_clocksource       ... ignored
test calibrator::tests::cloning_a_clocksource                           ... bench:           1 ns/iter (+/- 0)
test calibrator::tests::mpsc_calibrator_hot_path_loop_overhead          ... bench:          35 ns/iter (+/- 0)
test calibrator::tests::triple_buffer_calibrator_hot_path_loop_overhead ... bench:          28 ns/iter (+/- 0)
test tests::calls_rdtsc_directly                                        ... bench:          14 ns/iter (+/- 0)
test tests::calls_std_instant_now                                       ... bench:          25 ns/iter (+/- 0)
test tests::calls_std_system_time_now                                   ... bench:          25 ns/iter (+/- 3)
test tests::it_creates_a_duration                                       ... bench:           1 ns/iter (+/- 0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.