
Profiling Optimization
This one walks you through finding performance bottlenecks using CPU profiling, flame graphs, and benchmarking across multiple languages. You get working examples for Node.js perf_hooks, Chrome DevTools profiling, Python's cProfile, and database query analysis. The approach is sensible: profile first, focus on hot paths, measure everything. What I like is it includes both the instrumentation code and the tooling to actually visualize what's slow, not just raw timing data. The best practices are refreshingly pragmatic about not optimizing cold paths or sacrificing readability for negligible gains. Solid reference if you're investigating slow requests or need to justify optimization work with real data instead of hunches.
- skills.sh installs
- 456
- GitHub stars
- 379
- last updated
- Aug 21, 2026
Install
$ npx -y skills add aj-geddes/useful-ai-prompts --skill profiling-optimization --agent claude-codeInstalls into .claude/skills of the current project.
Files
Profiling & Optimization
Table of Contents
Overview
Profile code execution to identify performance bottlenecks and optimize critical paths using data-driven approaches.
When to Use
- Performance optimization
- Identifying CPU bottlenecks
- Optimizing hot paths
- Investigating slow requests
- Reducing latency
- Improving throughput
Quick Start
Minimal working example:
import { performance, PerformanceObserver } from "perf_hooks";
class Profiler {
private marks = new Map<string, number>();
mark(name: string): void {
this.marks.set(name, performance.now());
}
measure(name: string, startMark: string): number {
const start = this.marks.get(startMark);
if (!start) throw new Error(`Mark ${startMark} not found`);
const duration = performance.now() - start;
console.log(`${name}: ${duration.toFixed(2)}ms`);
return duration;
}
async profile<T>(name: string, fn: () => Promise<T>): Promise<T> {
const start = performance.now();
Sponsors
Details
- Repository
- github.com/aj-geddes/useful-ai-prompts
- Categories
- AI & Agent Building, Debugging
- First seen
- Jun 3, 2026
More from aj-geddes/useful-ai-prompts
All 258- Cpu Profiling455
- Security Documentation455
- Frontend Routing454
- Load Balancer Setup454
- Property Based Testing454
- Aws Rds Database453
- Log Aggregation453
- Documentation Site Setup452
- Monorepo Management451
- Retrospective Facilitation451
- Api Filtering Sorting450
- Cloud Migration Planning450
- Design Handoff450
- Git Hooks Setup450
- Cloud Storage Optimization449
- Performance Regression Debugging449
- Secrets Management449
- Configuration Management448
- Alert Management447
- Cloud Cost Management447
- Troubleshooting Guide447
- Vue Application Structure447
- Database Sharding446
- Network Security Groups446