← Back to Skills Marketplace
alirezarezvani

performance-profiler

by Alireza Rezvani · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
313
Downloads
0
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install cs-performance-profiler
Description
Performance Profiler
README (SKILL.md)

Performance Profiler

Tier: POWERFUL
Category: Engineering
Domain: Performance Engineering


Overview

Systematic performance profiling for Node.js, Python, and Go applications. Identifies CPU, memory, and I/O bottlenecks; generates flamegraphs; analyzes bundle sizes; optimizes database queries; detects memory leaks; and runs load tests with k6 and Artillery. Always measures before and after.

Core Capabilities

  • CPU profiling — flamegraphs for Node.js, py-spy for Python, pprof for Go
  • Memory profiling — heap snapshots, leak detection, GC pressure
  • Bundle analysis — webpack-bundle-analyzer, Next.js bundle analyzer
  • Database optimization — EXPLAIN ANALYZE, slow query log, N+1 detection
  • Load testing — k6 scripts, Artillery scenarios, ramp-up patterns
  • Before/after measurement — establish baseline, profile, optimize, verify

When to Use

  • App is slow and you don't know where the bottleneck is
  • P99 latency exceeds SLA before a release
  • Memory usage grows over time (suspected leak)
  • Bundle size increased after adding dependencies
  • Preparing for a traffic spike (load test before launch)
  • Database queries taking >100ms

Golden Rule: Measure First

# Establish baseline BEFORE any optimization
# Record: P50, P95, P99 latency | RPS | error rate | memory usage

# Wrong: "I think the N+1 query is slow, let me fix it"
# Right: Profile → confirm bottleneck → fix → measure again → verify improvement

Node.js Profiling

→ See references/profiling-recipes.md for details

Before/After Measurement Template

## Performance Optimization: [What You Fixed]

**Date:** 2026-03-01  
**Engineer:** @username  
**Ticket:** PROJ-123  

### Problem
[1-2 sentences: what was slow, how was it observed]

### Root Cause
[What the profiler revealed]

### Baseline (Before)
| Metric | Value |
|--------|-------|
| P50 latency | 480ms |
| P95 latency | 1,240ms |
| P99 latency | 3,100ms |
| RPS @ 50 VUs | 42 |
| Error rate | 0.8% |
| DB queries/req | 23 (N+1) |

Profiler evidence: [link to flamegraph or screenshot]

### Fix Applied
[What changed — code diff or description]

### After
| Metric | Before | After | Delta |
|--------|--------|-------|-------|
| P50 latency | 480ms | 48ms | -90% |
| P95 latency | 1,240ms | 120ms | -90% |
| P99 latency | 3,100ms | 280ms | -91% |
| RPS @ 50 VUs | 42 | 380 | +804% |
| Error rate | 0.8% | 0% | -100% |
| DB queries/req | 23 | 1 | -96% |

### Verification
Load test run: [link to k6 output]

Optimization Checklist

Quick wins (check these first)

Database
□ Missing indexes on WHERE/ORDER BY columns
□ N+1 queries (check query count per request)
□ Loading all columns when only 2-3 needed (SELECT *)
□ No LIMIT on unbounded queries
□ Missing connection pool (creating new connection per request)

Node.js
□ Sync I/O (fs.readFileSync) in hot path
□ JSON.parse/stringify of large objects in hot loop
□ Missing caching for expensive computations
□ No compression (gzip/brotli) on responses
□ Dependencies loaded in request handler (move to module level)

Bundle
□ Moment.js → dayjs/date-fns
□ Lodash (full) → lodash/function imports
□ Static imports of heavy components → dynamic imports
□ Images not optimized / not using next/image
□ No code splitting on routes

API
□ No pagination on list endpoints
□ No response caching (Cache-Control headers)
□ Serial awaits that could be parallel (Promise.all)
□ Fetching related data in a loop instead of JOIN

Common Pitfalls

  • Optimizing without measuring — you'll optimize the wrong thing
  • Testing in development — profile against production-like data volumes
  • Ignoring P99 — P50 can look fine while P99 is catastrophic
  • Premature optimization — fix correctness first, then performance
  • Not re-measuring — always verify the fix actually improved things
  • Load testing production — use staging with production-size data

Best Practices

  1. Baseline first, always — record metrics before touching anything
  2. One change at a time — isolate the variable to confirm causation
  3. Profile with realistic data — 10 rows in dev, millions in prod — different bottlenecks
  4. Set performance budgetsp(95) \x3C 200ms in CI thresholds with k6
  5. Monitor continuously — add Datadog/Prometheus metrics for key paths
  6. Cache invalidation strategy — cache aggressively, invalidate precisely
  7. Document the win — before/after in the PR description motivates the team
Usage Guidance
This is a legitimate profiling cookbook. Before you use it: (1) Never expose debug endpoints (heap snapshot, /debug/pprof) publicly — protect them with authentication, network ACLs, or bind to localhost. (2) Heap snapshots and pprof data may contain sensitive memory (tokens, PII), so store and share them carefully and delete after use. (3) Run heavy profiling and load tests against staging or isolated environments to avoid impacting production. (4) Installing global tooling (npm -g, pip) is optional — prefer virtualenvs/containers. (5) Audit any code you paste from the guide before adding debug endpoints to your app. If you want a stricter check, provide the exact commands you plan to run and the environment (prod/staging) so potential hazards can be reviewed.
Capability Analysis
Type: OpenClaw Skill Name: cs-performance-profiler Version: 1.0.0 The skill bundle is a comprehensive and legitimate toolkit for performance engineering across Node.js, Python, and Go environments. It provides standard industry practices and code snippets for CPU/memory profiling, database optimization, and load testing using established tools like clinic.js, py-spy, pprof, and k6. While it includes powerful capabilities such as heap snapshot generation and process inspection, these are strictly aligned with the stated purpose of performance analysis and include explicit security warnings (e.g., protecting debug endpoints with authentication) in files like SKILL.md and references/profiling-recipes.md.
Capability Assessment
Purpose & Capability
The name/description (performance profiling) matches the content: Node.js/Python/Go profiling, flamegraphs, bundle analysis, DB EXPLAINs, and load testing. Nothing in the files asks for unrelated credentials, binaries, or system-wide access that would be inconsistent with profiling.
Instruction Scope
SKILL.md and references contain concrete instructions to add debug endpoints (/debug/heap-snapshot, pprof endpoints), run profilers, and run load tests. These are expected for profiling, but they can expose sensitive memory/state or administrative endpoints if not properly protected and can cause production impact if run against live traffic. The guidance sometimes reminds to 'protect with auth' or 'use staging', but enforcement is left to the operator.
Install Mechanism
This is an instruction-only skill with no install spec or code files. The docs suggest installing tools (clinic, py-spy, memory-profiler) via npm/pip, which is normal for profiling workflows and are executed by the user rather than installed by the skill itself.
Credentials
No environment variables, credentials, or config paths are required by the skill. The content references typical env usage (e.g., ANALYZE=true) and monitoring services, but does not request tokens or secrets — this is proportionate to its purpose.
Persistence & Privilege
The skill does not request persistent presence, does not modify other skills, and is not always-enabled. It’s a passive instruction set the agent can follow when invoked.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cs-performance-profiler
  3. After installation, invoke the skill by name or use /cs-performance-profiler
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial publish (prefixed slug)
v2.1.2
- Added comprehensive documentation outlining the skill's profiling features for Node.js, Python, and Go. - Included clear guidance for before/after measurement and benchmarking optimizations. - Provided practical checklists for common performance bottlenecks and quick optimization wins. - Added best practices and common pitfalls to improve profiling accuracy and effectiveness. - Introduced a standardized template for documenting performance improvements.
Metadata
Slug cs-performance-profiler
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is performance-profiler?

Performance Profiler. It is an AI Agent Skill for Claude Code / OpenClaw, with 313 downloads so far.

How do I install performance-profiler?

Run "/install cs-performance-profiler" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is performance-profiler free?

Yes, performance-profiler is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does performance-profiler support?

performance-profiler is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created performance-profiler?

It is built and maintained by Alireza Rezvani (@alirezarezvani); the current version is v1.0.0.

💬 Comments