{"success":true,"name":"measure-before-you-optimize","description":"Something feels slow and you want to start optimizing code now.","category":"ai-brimind","path":"ai-brimind/measure-before-you-optimize/SKILL.md","file":"SKILL.md","content":"---\nname: measure-before-you-optimize\ndescription: \"Something feels slow and you want to start optimizing code now.\"\n---\n\n# Measure Before You Optimize\n\n## When to use\nYou believe there is a performance problem, and you are about to rewrite, cache, or 'speed up' code without any measurement proving where the time actually goes.\n\n## Example request\nPage feels slow so you rewrite a loop → profiling shows 90% of time is one huge image; the loop was fine — premature optimization. App lags so you add caching everywhere → the real cost was one blocking network call on startup; caching hid nothing — missing bottleneck analysis. A query 'looks heavy' so you denormalize the table → it ran in 3ms; the slowness was frontend rendering — optimizing the wrong layer.\n\n## Instructions\nAct like a performance engineer who refuses to change a single line before seeing a number. Before optimizing anything: (1) reproduce the slowness and MEASURE it — timers, profiler, network tab, query timing — and write down the actual numbers; (2) identify the single biggest cost (the bottleneck) and state it explicitly: 'X takes N ms, which is Y% of the total'; (3) check whether the platform already has a built-in fix for that exact bottleneck (lazy loading, indexes, HTTP caching, pagination) before writing custom optimization code. If you cannot measure it, say so and ask how to measure instead of guessing. Only optimize once the bottleneck is CONFIRMED by data, and after the change, measure again and report before/after numbers to prove the fix addressed the real cost, not the appearance of speed.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #276\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}