Skip to content
aj-geddes avatar

Profiling Optimization

Structured profiling workflow covering CPU profiling, flame graphs, and benchmarking for performance bottlenecks.

CCM score
38 of 100
skills.sh installs
457
GitHub stars
396
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers hot-path optimization workflow: profile first, locate bottlenecks, change code, then measure the impact
  • Includes reference guides for Node.js, Chrome DevTools CPU profiles, Python cProfile, benchmarking, database query profiling, and flame graphs
  • Provides a TypeScript Profiler class with mark, measure, and async profile helpers for timing code sections
  • Enforces measurement before and after every change, and discourages optimizing cold paths or sacrificing readability for minor gains

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill profiling-optimization -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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();

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Debugging, Code Review & Quality
First seen
Jun 3, 2026

Questions

What does the profiling-optimization skill do?

The profiling-optimization skill profiles application performance, identifies bottlenecks, and optimizes hot paths using CPU profiling, flame graphs, and benchmarking. It is meant for investigating performance issues or optimizing critical code paths.

How do I install the profiling-optimization skill?

Run npx -y skills add aj-geddes/useful-ai-prompts --skill profiling-optimization -y in your project. Once installed, the agent can profile code and produce flame graphs and benchmarks.

Which tools does profiling-optimization cover?

The skill has reference guides for Node.js profiling, Chrome DevTools CPU profiles, Python cProfile, benchmarking, database query profiling, and flame graph generation. Its quick start uses the Node.js perf_hooks module for timing.

Where does profiling-optimization sit among debugging skills?

It is in the Debugging category on Claude Marketplaces, alongside diagnosing-bugs, safe-debug, systematic-debugging, and sentry-cli. Where those focus on finding and fixing bugs, this skill focuses on measuring where execution time goes.

More from aj-geddes/useful-ai-prompts

All 258

Similar to Profiling Optimization

More Debugging