Files
PDF-to-DWG-converter/.cursor/rules/performance.mdc
T
2026-07-30 13:14:21 -04:00

17 lines
773 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: Performance — avoid N+1, cache wisely, measure before optimizing
alwaysApply: false
---
# Performance
- Measure before optimizing. Profile hot paths; do not guess bottlenecks.
- Fix N+1 queries: use eager loading, joins, or batch fetches.
- Cache expensive reads with explicit TTL and invalidation strategy.
- Lazy-load heavy modules and routes not needed on initial page load.
- Paginate large lists — never load unbounded datasets into memory.
- Debounce search inputs and resize handlers (typically 200–300ms).
- Compress and resize images. Serve modern formats (WebP, AVIF) where supported.
- Avoid blocking the main thread with heavy sync work — use workers or server-side processing.
- Set appropriate HTTP cache headers for static assets.