Giter Site home page Giter Site logo

Comparing to `minstant` about quanta HOT 9 OPEN

metrics-rs avatar metrics-rs commented on June 18, 2024
Comparing to `minstant`

from quanta.

Comments (9)

tobz avatar tobz commented on June 18, 2024 2

It wouldn't take multiple months of work, just that given the time I'm able to allocate to my open-source projects and the effort to implement and test these things to satisfactory level would likely end up taking me a few months.

(edited because my original response was unintentionally harsh.)

from quanta.

tobz avatar tobz commented on June 18, 2024 1

No worries. My response was unintentionally harsh and I've edited it. Sorry about that.

Hopefully, whenever it happens, you/me/we/whoever can work on this stuff and get it into quanta. It would definitely be a nice improvement. 👍🏻

from quanta.

loyd avatar loyd commented on June 18, 2024 1

After fixing #82, I checked also minstant (the first number is a count of parallel threads):

        std             minstant       quanta
1:  1187.1±138.65ns   18.5±6.52ns    13.2±6.88ns 
2:  1433.9±158.59ns   31.3±9.89ns    16.9±6.11ns 
3:  1384.1±71.93ns    30.9±10.81ns   17.2±6.37ns 
4:  1407.1±159.88ns   28.7±10.84ns   16.9±5.78ns 
5:  1367.0±62.41ns    30.4±11.10ns   17.8±5.71ns 
6:  1411.6±167.61ns   30.6±10.93ns   17.3±5.68ns 
7:  1396.0±83.37ns    28.9±10.54ns   17.5±6.30ns 
8:  1390.6±81.05ns    29.4±11.40ns   17.2±5.62ns 
9:  1436.7±113.11ns   29.5±10.48ns   24.9±9.90ns 
10: 1399.3±84.62ns    29.1±11.33ns   25.8±9.92ns 
11: 1388.3±64.43ns    28.0±10.45ns   25.9±9.36ns 
12: 1395.2±60.53ns    25.5±9.21ns    24.0±7.32ns 

It doesn't have problems with contention, but numbers differ from benchmarks in minstant's repository for basic cases for my CPU (AMD Ryzen 7 4800HS), that's interesting.

Also, minstant cannot replace quanta (for my case) until any sort of mocks is provided.

from quanta.

tobz avatar tobz commented on June 18, 2024

Hi there!

I've actually looked at minstant before when checking out minitrace. Cool stuff, always fun to see how close to the metal you can make a thing. :)

I'll start with calibration delay. I wouldn't be against a PR that switches the global calibration to automatically run at process start. This one seems like the easiest to achieve in a cross-platform way given rust-ctor's statement of platform support.

As far as per-CPU core deviation: you're right, quanta doesn't currently per-core TSC offset compensation. That's currently an open-ish issue (#61) after an end user hit a weird bug where one of their cores had a very skewed TSC offset due a BIOS firmware issue.

My main reservation with adding such logic is that it should ideally be cross-platform, so ff the top of my head, we would need:

  • cross-platform way of getting list of CPU IDs (looks like cpu-affinity crate can do this)
  • cross-platform way of setting thread/CPU affinity (cpu-affinity can also do this)

That gets us a way to do the calibration on a per-CPU basis, although the value of TSC_AUX is still OS-dependent, so we could store per-CPU offsets for Linux, but nothing else.. so we'd probably end up mirroring what minstant has with TSCLevel::Stable vs TSCLevel::PerCPU.

All of this is a long way of saying: I think quanta could address these problems, but my biggest focus with the library is doing things with a cross-platform-first mentality, and avoiding making assumptions around things i.e. that the process has certain permissions to access files, or MSRs, etc.

I'm definitely open to PRs to try and incrementally improve the situation, but I'm not sure if I would personally be able to get these types of changes in a timeframe of anything less than multiple months.

from quanta.

andylokandy avatar andylokandy commented on June 18, 2024

Thanks for your quick reply! I think we can't wait for multiple months. But why will it take that long as you have mentioned that rust-ctor and cpu-affinity are cross-platform?

from quanta.

andylokandy avatar andylokandy commented on June 18, 2024

Oh, I've just misunderstood. I thought you were saying it'll take several months to review the PR.

Definitely, we'd like to make a PR but we've decided to stick with minstant so far because we're going to publish minitrace-rust soon. We'll step back to quanta afterward.

from quanta.

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.