Performance bottleneck diagnosis from profiler output

by fidji DeepSeek English ~660 tokens
Public excerpt Locked
Is the profile valid (debug mode, warm-up, data size)? Top frames by self time and inclusive time, classify the cost (CPU, I/O wait, locks, allocation/GC, N+1), rank hypotheses, compute the ceiling gain with Amdahl before optimising…

About this prompt

Paste a flame graph, profiler table, EXPLAIN ANALYZE or APM trace with the code: the prompt first checks the measurement is trustworthy, then reads self vs total time, ranks hypotheses with evidence, estimates the possible gain with Amdahl’s law before you touch anything, and gives a before/after benchmark protocol. DeepSeek fits the numeric reasoning.

Example output

Provided by the author
STEP 1 — Valid for CPU, but 38 % of wall time is outside the sampled stacks → capture a wall-clock profile too. Xdebug is listed in loaded extensions: disable it and re-measure, it can inflate PHP time 2–5×. STEP 2 — Hot path ReportController::show (100 %) → ReportBuilder::rows (81 %) → LineItem::getProduct (63 %, 4,812 calls, 0.53 ms each) → PDOStatement::execute (60 %) Reading: 4,812 identical single-row SELECTs → N+1 on products. STEP 3 H1 (strong): N+1 in getProduct(). Confirm: count queries per request (expect ≈ 4,800). H2 (weak): number_format in a loop, 4 % self time — not worth it. STEP 4 — Ceiling H1: p = 0.60, one batched query ≈ 30× faster → 0.40 + 0.60/30 = 0.42 → 4.2 s × 0.42 ≈ 1.8 s. Target 0.8 s NOT reached by H1 alone; remaining 40 % is in template rendering (to profile next)…

Details

Model
DeepSeek
Prompt language
English
Who it's for
Backend and full-stack developers facing a slow endpoint, job or page with profiling data in hand
Length
~660 tokens (estimate)
Delivered as
Prompt text, shown online after purchase

Reviews

Buyers only

No reviews yet. Only buyers of this prompt can leave one.

Report this prompt