Git Product home page Git Product logo

Comments (3)

rylev avatar rylev commented on August 21, 2024

Turns out the issue is that Windows SystemTime does not support time intervals smaller than 100 nanoseconds. The tests are using intervals much smaller than that and when we add a duration to system times that are smaller than 100 nanoseconds, you'll end up not actually adding any time (i.e., the system time you get after the addition is the same as the one before).

You can see where we divide nanoseconds into 100 nanosecond chunks in stdlib here.

To fix this we need to use a time mechanism that has more precision than 100 nanosecond intervals.

from measureme.

michaelwoerister avatar michaelwoerister commented on August 21, 2024

@eddyb mentioned that a fix for this should also take care of the case when we are not actually dealing with timestamps, such as when recording instructions counts.

from measureme.

eddyb avatar eddyb commented on August 21, 2024

For generalized handling of counters, we've been serializing this as counter.units in the JSON:

Counter::WallTime(_) => (
WallTime::NAME,
r#"[["ns", 1], ["μs", 1000], ["ms", 1000000], ["s", 1000000000]]"#,
),
Counter::Instructions(_) => (Instructions::NAME, r#"[["instructions", 1]]"#),
Counter::InstructionsMinusIrqs(_) => {
(InstructionsMinusIrqs::NAME, r#"[["instructions", 1]]"#)
}
Counter::InstructionsMinusRaw0420(_) => {
(InstructionsMinusRaw0420::NAME, r#"[["instructions", 1]]"#)
}

So we should be able to pretty-print an u64 that measures nanoseconds, as the appropriate unit for a maximum number of "significant digits". It's just going to be annoying to thread that state through.

from measureme.

Related Issues (20)

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.