agentsclimarketplace

Performance review

Skill yigityildiz0/universal-ai-skill-library/skills/common/performance-review

Profile performance, detect bottlenecks, analyze resource usage, caching strategies, and boundary conditions. Use when addressing performance issues.From its SKILL.md

Install
npx -y skills add yigityildiz0/universal-ai-skill-library --skill performance-review

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

3 things to look at

  • 21 days oldThe repository was created 21 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

6.7 KB, ~1.6k tokens by cl100k_base, as published. Nobody here has run it

Code Review - Performance Review

Identify performance bottlenecks, caching issues, and optimization opportunities. This skill is Phase 4 of the 6-phase code review methodology.

When to Use This Skill

Use this skill when you need to:

  • Identify performance bottlenecks
  • Optimize critical code paths
  • Reduce resource consumption
  • Improve response times
  • Address scalability concerns
  • Profile memory and CPU usage
  • Evaluate caching strategies

Trigger phrases: "performance review", "bottleneck", "slow code", "optimize", "profiling", "latency", "throughput", "memory usage", "caching"

What This Skill Does

Performance Dimensions

DimensionMetrics
TimeResponse time, latency, throughput
MemoryHeap usage, allocations, leaks
CPUUtilization, hot paths
I/ODatabase queries, network calls
ConcurrencyThreading, async efficiency
CachingHit rate, TTL, invalidation

Severity Classification

LevelAliasDescription
P0CRITICALProduction outages, severe degradation
P1HIGHSignificant performance impact
P2MEDIUMNotable inefficiency
P3LOWMinor optimization opportunity

Instructions

Step 1: Profile Application

# Python
python -m cProfile -s cumtime script.py
py-spy record -o profile.svg -- python script.py

# JavaScript/Node.js
node --prof app.js
clinic doctor -- node app.js

# Java
java -XX:+FlightRecorder -XX:StartFlightRecording=duration=60s,filename=app.jfr App

Step 2: Identify Hot Paths

  1. CPU Profiling

    • Functions with highest cumulative time
    • Frequent function calls
    • Complex algorithms
  2. Memory Analysis

    • Large object allocations
    • Memory leaks
    • Garbage collection pressure
    • Event listener leaks (registered but never removed)
  3. I/O Analysis

    • N+1 query patterns
    • Unoptimized database queries
    • Unnecessary network calls

Step 3: Common Anti-Patterns

Reference: references/code-quality-checklist.md (Performance & Caching section)

Anti-PatternIssueSolution
N+1 QueriesLoop database callsBatch queries, joins
Large PayloadsExcessive data transferPagination, field selection
No CachingRepeated computationsAdd caching layer
Sync I/OBlocking operationsAsync/await
String ConcatenationMemory allocation in loopsStringBuilder/join
Missing MemoizationSame pure function called repeatedlyAdd memoization
Over-fetchingSELECT * when only 2 columns neededSelect specific columns
No PaginationLoading entire tablesLIMIT/OFFSET or cursor pagination

Step 4: Caching Strategy Analysis

IssueRiskDiagnostic
Missing cacheRepeated expensive computations"Is this expensive operation called more than once with the same inputs?"
Cache without TTLStale data served indefinitely"How long is cached data valid?"
No invalidation strategyCache and database drift"When the source data changes, how is the cache updated?"
Key collisionsDifferent data overwriting each other"Could two different inputs produce the same cache key?"
User data cached globallyData leaks between users"Does the cache key include user/tenant identity?"
Cache stampedeAll caches expire simultaneously"What happens when the cache expires under load?"

Step 5: Boundary Conditions Affecting Performance

Reference: references/code-quality-checklist.md (Boundary Conditions section)

ConditionPerformance Impact
Unbounded collectionsLists/maps growing without limit, OOM risk
Large file loadingReading entire files into memory instead of streaming
String concatenation in loopsO(n^2) memory allocation
Empty collection edge cases.reduce() without initial value, .sort() on empty arrays

Step 6: Diagnostic Questions

Apply these questions to each module under review:

  1. "What is the most expensive operation in the critical path? Can it be cached, batched, or deferred?"
  2. "Are there any N+1 query patterns? (Loop that issues a query per iteration)"
  3. "Is there any unbounded data structure that grows with input size?"
  4. "For cached data, what is the TTL and invalidation strategy?"

Step 7: Document Findings

## Performance Finding

**File**: [path/to/file.py:42]
**Severity**: P1 (HIGH)
**Impact**: 500ms added latency per request
**Category**: Database Query

### Issue
N+1 query pattern in user loading

### Current Code
```python
users = User.query.all()
for user in users:
    orders = Order.query.filter_by(user_id=user.id).all()

Optimized Code

users = User.query.options(
    joinedload(User.orders)
).all()

Expected Improvement

  • Latency: 500ms -> 50ms
  • Database queries: N+1 -> 1

## Language-Specific Tools

### Python
- cProfile, py-spy, memory_profiler
- line_profiler, tracemalloc

### JavaScript
- Chrome DevTools, Node.js profiler
- clinic.js, 0x

### Java
- JFR, VisualVM, async-profiler
- JMH for benchmarks

### Go
- pprof, trace
- benchmarks

### C# / .NET
- dotTrace, dotMemory
- BenchmarkDotNet

## Quality Checklist

- [ ] Application profiled
- [ ] Hot paths identified
- [ ] Database queries analyzed (N+1, missing indexes, over-fetching)
- [ ] Memory usage reviewed (leaks, unbounded collections)
- [ ] Caching strategy evaluated (TTL, invalidation, stampede)
- [ ] Boundary conditions checked
- [ ] Diagnostic questions applied to each module
- [ ] Findings documented with metrics and severity (P0-P3)

## Related Skills

- `context-analysis` - Context understanding (Phase 1)
- `code-quality` - Code quality + SOLID review (Phase 2)
- `security-review` - Security analysis (Phase 3)
- `performance-testing` - Load testing
- `testing-review` - Test assessment (Phase 5)
- `final-report` - Consolidated report (Phase 6)

---

**Version**: 2.0.0
**Last Updated**: February 2026
**Based on**: DevAI-Hub code review methodology + code-review-expert


### Iterative Refinement Strategy
This skill is optimized for an iterative approach:
1. **Execute**: Perform the core steps defined above.
2. **Review**: Critically analyze the output (coverage, quality, completeness).
3. **Refine**: If targets aren't met, repeat the specific implementation steps with improved context.
4. **Loop**: Continue until the definition of done is satisfied.

What ships with it: 1 file

286 B alongside SKILL.md

agents/

Keep looking

Skills are one crate of 326,861. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.