koute / not-perf

A sampling CPU profiler for Linux
Apache License 2.0
871 stars 41 forks source link

Feature: Increase concurrency of flamegraph rendering #30

Open kwannoel opened 1 year ago

kwannoel commented 1 year ago

Background

Typically I use nperf to render a flamegraph like so.

    nperf flamegraph --merge-threads perf.data > perf.svg

htop shows it just uses a single cpu core used: Screenshot 2023-03-22 at 5 12 52 PM

It takes a long while to render the flamegraph on a Machine with 8 CPUs, 16GB RAM.

Will it be possible add an option to increase concurrency of flamegraph generation? I'm not too familiar with the internals of nperf.

I will definitely be more than happy to investigate, and try implementing it, if it's a good feature to have.

kwannoel commented 1 year ago

Took a further look, seems like flamegraph rendering depends on inferno::flamegraph. There's an open issue for that there: https://github.com/jonhoo/inferno/issues/256.

I guess it has to be fixed upstream first, and just bump dependency after. Keeping this issue open as a reminder (for myself) to bump dependency.

kwannoel commented 1 year ago

~Seems like it might have been fixed, will try to bump dependency and see how it is.~

Edit: After bumping dependency it's still slow, I realized it's a different issue 😢 Seems to be for loading the svg instead into browser.... will look into it further...