0
Interpret a flamegraph and turn it into a prioritized optimization list
I'm pasting a description or text export of a CPU flamegraph / profiler output for service_name. Help me turn it into action, not just commentary:
1. Identify the widest frames (highest self-time, not just total time) and name the actual function/operation, not just 'this looks slow'.
2. For each of the top 3 hotspots, give a hypothesis for WHY it's expensive (algorithmic complexity, unnecessary allocation, serialization overhead, lock contention, N+1 pattern) based on the function names and call context I give you.
3. Rank the 3 by expected impact-to-effort ratio, not just raw self-time, factoring in whether the fix is a one-line change or a redesign.
4. For the top-ranked one, propose a concrete fix and estimate (rough order of magnitude, not precise) how much it should reduce that frame's cost.
5. Note any hotspot that's actually expected/acceptable (e.g. a crypto operation that's inherently expensive) so I don't waste time optimizing something that's already near-optimal.
Profiler output / description: profile_data
Language/runtime: language
Context (request volume, latency budget): context