Measure, diagnose, and safely improve Mcode performance across startup, frontend rendering, rerenders, frame stability, CPU, memory, GPU, IPC, bundle size, and data paths. Use before a benchmark, profiler investigation, or implementation justified by speed, responsiveness, resource use, or scalability.
Resources
1Install
npx skillscat add mzeey-empire/mcode/performance-engineer Install via the SkillsCat registry.
This skill measures, diagnoses, and improves Mcode performance across startup, rendering, CPU, memory, and bundle size. It provides a structured workflow for attributing performance costs and making minimal changes while preserving behavior. Use it before benchmarks, profiler investigations, or when optimizing for speed, responsiveness, or resource use.
Performance Engineer
Optimize a measured critical path. Preserve behavior while you attribute the cost, make the smallest useful change, and verify the result with the same measurement.
This skill adapts the workflow from Emanuele-web04/skills for Mcode.
Workflow
- Read `docs/guides/performance-audit.md`. It owns Mcode's budgets, evidence rules, and runtime-specific controls.
- Name the exact user-visible or system-visible path. Define its environment, input, metric, and behavior invariants.
- Write one hypothesis:
<cost> is caused by <specific work> because <evidence>. - Capture a repeatable baseline before you edit. Separate cold from warm, development from release, and small from realistic input. Use multiple samples for noisy timings.
- Attribute the cost. Classify it as early work, repeated work, excess work, serial work, wrong data shape, N+1 work, render churn, layout churn, or an unsafe cache boundary.
- Make the smallest change that removes the measured cost. Keep public behavior, ordering, permissions, pagination, accessibility, and error behavior stable.
- Repeat the same measurement under the same conditions. Run focused behavior tests, live verification, and
bun run verifywhen the repository workflow requires them.
Frontend and Electron rule
Keep these signals separate:
- React Profiler data measures React commits and render duration.
- Chromium traces measure scripting, layout, paint, long tasks, and frame delivery.
- Electron
app.getAppMetrics()measures process CPU and memory. - OS counters or traces measure GPU-engine use. Render counts and Electron GPU information do not measure GPU utilization.
Record the hardware-acceleration state and keep it fixed within a comparison. Use a profiling build for React evidence and a normal production build without open DevTools for process and GPU evidence.
Completion evidence
Report:
- the target, environment, baseline, sample count, and statistic;
- the attributed cause and the files or trace events that support it;
- the smallest change and the behavior that stayed stable;
- before and after results from the same measurement;
- focused tests, live evidence, the regression gate, and residual uncertainty.
Do not claim a performance gain from a single sample, a scanner result, a microbenchmark outside the hot path, or a different environment.