Code Monkey home page Code Monkey logo

Comments (6)

zao avatar zao commented on July 30, 2024 2

I don't think I've got the mental bandwidth currently to fully implement this as it propagates throughout the program when you make the samples floating point.

In particular, it affects the lookups of TimedFrame due to f64 not having an ordering for Eq nor having a Hash.

I'd gladly leave it for another contributor or for a stream where you get to explain the Fun in why floats don't have decent orderings.

from inferno.

jasonrhansen avatar jasonrhansen commented on July 30, 2024 1

As far as I can tell there is no reason TimedFrame needs to be Eq or Hash. Frame is used as a key in a HashMap, but it doesn't have any fields relating to samples. TimedFrame is only ever stored in a Vec. I think we should be able to use f64 for start_time, end_time, and delta, or am I overlooking something?

from inferno.

jonhoo avatar jonhoo commented on July 30, 2024 1

I did some digging on this in #64 (comment), and my conclusion from reading brendangregg/FlameGraph#18 is that we should probably simply discard the fractional parts of samples, and add support for --factor instead.

from inferno.

jasonrhansen avatar jasonrhansen commented on July 30, 2024 1

#65 adds --factor instead.

from inferno.

jonhoo avatar jonhoo commented on July 30, 2024

Ah, yes, I think you're right! That would mean that the sample counts are all fractional (probably f64). Would you be willing to write up a PR with that change?

from inferno.

jonhoo avatar jonhoo commented on July 30, 2024

One trick we could play here is to upsample by, say, 100x, and then keep using usize 🤔

from inferno.

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.