Initial commit
This commit is contained in:
commit
f8e62b5dfa
50 files changed
+3211
No files matched your search
@@ -0,0 +1,16 @@
|
||||
---
|
||||
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.
|
||||
Reference in new issue
Block a user