performance-optimization
Skill1 starsChanged 35 days agoMITView on GitHub
Cross-stack performance optimization best practices covering frontend, backend, and database. Includes checklists, anti-patterns, profiling guidance, and practical examples for .NET, React, Node.js, Python, and SQL. Use when: "why is this slow", "optimize this", "profile this function", "this query is taking too long", "reduce memory usage", "lazy loading", "benchmark this".
156 other projects use a version of this.
Adopted by
Most recently taken up by
- albumentations-team/AlbumentationsXtheir own version, first seen Nov 29, 2026
- carlokop/skillstheir own version, first seen Nov 29, 2026
- dzikrisyairozi/agent-skillstheir own version, first seen Nov 29, 2026
- elidadutra187/claude-skillstheir own version, first seen Nov 29, 2026
- jaydubya818/MissionControltheir own version, first seen Nov 29, 2026
- sirius-cc-wu/sirius-skillstheir own version, first seen Nov 29, 2026
Used with
Projects with it also use accessibility-engineering, using-agent-skills and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
steven123397Skillaccessibility-engineering
Audits existing interfaces for WCAG 2.2 AA conformance and remediates the violations found. Use when auditing a page or component for accessibility, running axe-core or pa11y, triaging a11y violations, or checking screen reader and contrast issues before shipping.
Also in 4 projects that use this
LLl0k0laDSkillusing-agent-skills
Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.
Also in 40 projects that use this
MrCipherSmithSkillconstraint-driven-development
Use when a project needs a persistent, measurable quality bar — starting a project without documented standards, 'set up constraints', or when coverage/perf/a11y thresholds get re-debated per-PR. Produces CONSTRAINTS.md with enforceable numbers, ratchets, and a guard against silent weakening. NOT for throwaway prototypes or a one-off CI setup.
Also in 20 projects that use this
LLl0k0laDSkillidea-refine
Refine ideas through structured divergent and convergent thinking. Use "idea-refine" or "ideate" to trigger.
Also in 45 projects that use this
jaydubya818Skilldeprecation-and-migration
Retire APIs or migrate consumers and persistent data across releases.
Also in 46 projects that use this
jaydubya818Skillobservability-and-instrumentation
Add or review logs, metrics, traces, and actionable alerts.
Also in 36 projects that use this
- +5 more from LLl0k0laD
Other versions156 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 156
- addyosmani/agent-skills★ 121ksame name
- gamedev-skills/awesome-gamedev-agent-skills★ 9ksame name
- sanity-io/sanity★ 6.4ksame name
- compozy/compozy★ 2.9ksame name
- ollaya-dev/ollaya★ 1.5ksame name
- buddy-compiler/buddy-mlir★ 778same name
- ThibautBaissac/rails_ai_agents★ 665same name
- albumentations-team/AlbumentationsX★ 601same name
- derHaken/SuperAntigravity★ 439same name
- ukanwat/aaabench★ 399same name
146 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- appinsights-instrumentationSkill
- csharp-toolkitSkill
- delegateSkill
- deploy-verifySkill
- diagnoseSkill
- documentation-writerSkill
- flywheelSkill
- grill-meSkill
- javascript-typescript-jestSkill
- microsoft-docsSkill
- nuget-managerSkill
- python-fastapi-pytestSkill
- sql-toolkitSkill
- tddSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 0 are common, 15 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 138 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Avoid Premature Optimization: Write clear code first; optimize when needed.
- Very specific: line 24
Use React.memo, useMemo, useCallback to prevent unnecessary re-renders.
- Distinctive: line 25
Use stable keys in lists (not array indices).
- Distinctive: line 26
Prefer CSS transitions/animations over JavaScript for GPU-accelerated effects.
- Very specific: line 37
Use CDNs, Service Workers, <link rel="preload">.
- Very specific: line 38
Use defer/async for non-critical scripts.
- Distinctive: line 41
Don't block the main thread — use Web Workers for heavy computation.
- Distinctive: line 44
Use Maps/Sets for lookups, TypedArrays for numeric data.
- Distinctive: line 50
Avoid anonymous functions in render.
- Distinctive: line 65
Avoid O(n²) or worse — profile nested loops.
- Distinctive: line 69
Use async/await for I/O-bound work.
- Distinctive: line 76
Use TTL-based, event-based, or manual invalidation.
- Distinctive: line 81
Always paginate large result sets.
- Very specific: line 94
Never block the event loop (fs.readFileSync in production).
- Distinctive: line 118
Avoid N+1 queries — use JOINs or batch queries.
- Distinctive: line 123
Use the most efficient data types.
- Distinctive: line 127
Keep transactions short to reduce lock contention.
- Distinctive: line 128
Use the lowest isolation level that meets consistency needs.
- Distinctive: line 131
Read replicas for scaling reads.
“Common” is measured: kept by at least 6 in 10 of the 138 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Performance Optimization Best Practices
Your goal is to help me optimize code for performance across any layer of the stack.
General Principles
- Measure First, Optimize Second: Profile and benchmark before optimizing. Use tools like Chrome DevTools, Lighthouse, Py-Spy, dotTrace, or language-specific profilers.
- Optimize for the Common Case: Focus on frequently executed code paths.
- Avoid Premature Optimization: Write clear code first; optimize when needed.
- Minimize Resource Usage: CPU, memory, network, disk — always ask "can this be done with less?"
- Set Performance Budgets: Define limits for load time, memory, API latency. Enforce with automated checks.
Frontend Performance
Rendering and DOM
- Minimize DOM manipulations — batch updates, use document fragments.
- Use
React.memo,useMemo,useCallbackto prevent unnecessary re-renders. - Use stable keys in lists (not array indices).
- Prefer CSS transitions/animations over JavaScript for GPU-accelerated effects.
- Defer non-critical rendering with
requestIdleCallback.
Asset Optimization
- Compress images (WebP, AVIF). Use
loading="lazy"for images. - Minify and bundle JS/CSS (esbuild, Webpack, Rollup). Enable tree-shaking.
- Subset fonts, use
font-display: swap. - Set long-lived cache headers with cache busting.
Network
- Reduce HTTP requests. Enable HTTP/2 or HTTP/3.
- Use CDNs, Service Workers,
<link rel="preload">. - Use
defer/asyncfor non-critical scripts.
JavaScript
- Don't block the main thread — use Web Workers for heavy computation.
- Debounce/throttle scroll, resize, input events.
- Clean up event listeners, intervals, DOM references to prevent memory leaks.
- Use Maps/Sets for lookups, TypedArrays for numeric data.
Framework-Specific
React
React.memo,useMemo,useCallbackto avoid re-renders.- Code-split with
React.lazy+Suspense. - Avoid anonymous functions in render.
- Profile with React DevTools Profiler.
Angular
- OnPush change detection.
trackByinngFor. Lazy load modules.
Vue
- Computed properties over methods in templates.
v-showvsv-if. Lazy load routes.
Backend Performance
Algorithms and Data Structures
- Choose the right data structure: arrays for sequential, hash maps for lookups, trees for hierarchy.
- Avoid O(n²) or worse — profile nested loops.
- Batch processing and streaming for large datasets.
Concurrency
- Use async/await for I/O-bound work.
- Thread/worker pools to manage concurrency.
- Batch network/database calls to reduce round trips.
- Implement backpressure in queues and pipelines.
Caching
- Cache expensive computations (Redis, Memcached).
- Use TTL-based, event-based, or manual invalidation. Stale cache is worse than no cache.
- Cache stampede protection with locks or request coalescing.
API and Network
- Minimize payloads. Compress responses (gzip, Brotli).
- Always paginate large result sets. Use cursors for real-time data.
- Connection pooling for databases and external services.
- Rate limiting to protect APIs.
Language-Specific
.NET
async/awaitfor I/O.Span<T>,Memory<T>for efficient memory.IAsyncEnumerable<T>for streaming.- Profile with dotTrace, PerfView.
- Pool objects and connections.
Node.js
- Never block the event loop (
fs.readFileSyncin production). - Clustering or worker threads for CPU-bound tasks.
- Streams for large data processing.
- Profile with
clinic.jsornode --inspect.
Python
- Built-in
dict,set,dequefor speed.lru_cachefor memoization. multiprocessingorasynciofor parallelism.- Profile with
cProfile,line_profiler,Py-Spy.
Java
- Efficient collections. Thread pools (
Executors). - Tune JVM:
-Xmx,-Xms,-XX:+UseG1GC. - Profile with VisualVM, JProfiler.
Database Performance
Query Optimization
- Index columns used in WHERE, JOIN, ORDER BY. Drop unused indexes.
- Never SELECT *. Select only needed columns.
- Parameterized queries for safety and plan caching.
- Analyze query plans with
EXPLAIN. - Avoid N+1 queries — use JOINs or batch queries.
- Paginate with
LIMIT/OFFSETor cursors.
Schema Design
- Normalize to reduce redundancy; denormalize for read-heavy workloads.
- Use the most efficient data types.
- Partition large tables. Archive old data.
Transactions
- Keep transactions short to reduce lock contention.
- Use the lowest isolation level that meets consistency needs.
Caching and Replication
- Read replicas for scaling reads. Monitor replication lag.
- Cache query results in Redis/Memcached.
- Sharding for horizontal scalability.
Code Review Checklist
- Any O(n²) or worse algorithmic inefficiencies?
- Data structures appropriate for their use?
- Unnecessary computations or repeated work?
- Caching used where appropriate? Invalidation handled?
- Database queries optimized, indexed, free of N+1?
- Large payloads paginated, streamed, or chunked?
- Memory leaks or unbounded resource usage?
- Network requests minimized, batched, retried?
- Assets optimized, compressed, served efficiently?
- Blocking operations in hot paths?
- Performance-critical paths documented and tested?
Profiling and Benchmarking
- Profilers: Chrome DevTools, Py-Spy, VisualVM, dotTrace, PerfView
- Microbenchmarks:
benchmark.js,pytest-benchmark, JMH - Load testing: k6, Gatling, Locust
- A/B testing for real-world impact measurement
- Distributed tracing: OpenTelemetry, Jaeger, Zipkin
Scalability
- Horizontal scaling: stateless services, sharding, load balancers
- Auto-scaling with sensible thresholds
- Idempotent operations, retries, circuit breakers
Cloud and Serverless
- Minimize cold starts: keep dependencies lean, functions warm
- Tune memory/CPU allocation
- Monitor cloud cost as a performance metric
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

