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

Option for true "start" for nodes #187

Open
Mark-Simulacrum opened this issue Aug 9, 2020 · 1 comment
Open

Option for true "start" for nodes #187

Mark-Simulacrum opened this issue Aug 9, 2020 · 1 comment

Comments

@Mark-Simulacrum
Copy link

Currently, inferno, even in flame chart mode, doesn't really support passing in start time and end time (rather than just a count). This means that you can't get output like the chrome profiler tools -- note the gaps between some of the children nodes, rather than everything being left-aligned.

Ideally this would be an option of some sort, but I'm not sure how to best make it work with the string-based API...

Alternatively, inferno's SVG generation and such could be factored out such that it is called to arrange a tree of objects with explicit starts/stops and depths and it generates SVG and JS to deal with that. That would work too, and allow for much greater flexibility. It definitely feels like a harder project though :)

image

@jonhoo
Copy link
Owner

jonhoo commented Aug 10, 2020

Hmm, yeah, this'll be a challenge to add. inferno is very much built around what flamegraph does, and it is entirely focused on sample counts, not time. That said, inferno does ultimately compute a start and end time for each frame

let frame = TimedFrame {
location: key,
start_time: frame_time.start_time,
end_time: time,
delta: frame_time.delta,
};

So it should be possible to feed user input directly into that. What we'd need first is #30 ( see also #164). I know @Licenser started experimenting over in #98, but I don't think it got past the experimentation stage. @koute has also expressed interest in a library-based API (as opposed to a string-based one).

I'm pretty swamped these days, otherwise I'd be all over trying to build that library interface — it sounds like a fun challenge. Realistically, I probably won't be able to look at this much until November at the earliest. I'd be happy to try and guide a PR effort though! It may also be that @bcmyers, @jasonrhansen, or @AnderEnder can lend a hand — they also have a lot of experience with this codebase :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants