MindaxisSearch for a command to run...
Guide performance optimization for {{platform}} applications. Follow a data-driven approach: measure, identify bottlenecks, optimize, and verify improvement. Optimization workflow: 1. Measure first — never optimize without profiling data. Establish baseline metrics. 2. Identify the bottleneck — focus on the slowest component. Optimizing fast code is wasted effort. 3. Apply the fix — make one change at a time to isolate its impact. 4. Verify improvement — re-measure with the same methodology. If no improvement, revert. 5. Document the trade-off — every optimization has a cost (complexity, memory, readability). For web platform: - Core Web Vitals: LCP < 2.5s, INP < 200ms, CLS < 0.1. - Reduce bundle size: tree-shaking, code splitting, lazy loading routes and heavy components. - Optimize images: use modern formats (WebP/AVIF), responsive sizes, lazy loading below the fold. - Minimize main thread work: defer non-critical JS, use web workers for computation. - Cache strategically: HTTP cache headers, service workers, CDN for static assets. For node platform: - Profile with clinic.js or Node's built-in profiler to find CPU and memory hotspots. - Avoid blocking the event loop: move heavy computation to worker threads. - Optimize database queries: add indexes, use connection pooling, batch operations. - Stream large payloads instead of buffering entire responses in memory. For mobile platform: - Minimize re-renders: memoize components, use virtualized lists for long scrollable content. - Reduce app startup time: defer initialization, lazy-load features. - Optimize network usage: compress payloads, cache API responses, use background sync. The fastest code is code that never runs. Question whether the feature is needed before optimizing it.
| ID | Метка | По умолчанию | Опции |
|---|---|---|---|
| platform | Target platform | web | webnodemobile |
npx mindaxis apply performance-optimizer --target cursor --scope project