JS/TS Performance Audit

    by Tiago Bértolo

    0

    Audit JavaScript and TypeScript codebases to eliminate runtime bottlenecks, memory leaks, and O(n^2) algorithmic waste.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    JS/TS Performance Audit

    Example session with this skill installed

    Audit src/services/user-processor.ts for cost. The file handles batch updates of user records in a loop.

    • Read your context and instructions
    • Compiled the js ts performance

    I have audited src/services/user-processor.ts focusing on reducing compute cost.

    Goal: cost (asked)

    Findings

    #ImpactRiskWhereProblem → fix
    1HighNonesrc/services/user-processor.ts:42includes() inside batch loop, O(n * m) → Set, O(n + m)
    2MediumLowsrc/services/user-processor.ts:88Sequential await on independent lookups → Promise.all
    3MediumNonesrc/services/user-processor.ts:102Rebuilding Intl.DateTimeFormat in loop → hoist to module scope

    1. O(n^2) lookup in batch loop

    The processor checks every user ID against a list of blacklisted IDs using array.includes(). Converting the blacklist to a Set before the loop removes redundant scans.

    // Before
    const filtered = users.filter(u => !blacklist.includes(u.id));
    
    // After
    const blacklistSet = new Set(blacklist);
    const filtered = users.filter(u => !blacklistSet.has(u.id));
    

    2. Parallelize metadata fetches

    The fetchProfile and fetchPermissions calls do not depend on each other. Running them concurrently reduces worker idle time.

    // Before
    const profile = await fetchProfile(id);
    const perms = await fetchPermissions(id);
    
    // After
    const [profile, perms] = await Promise.all([fetchProfile(id), fetchPermissions(id)]);
    

    Memoization candidates (confirmation required)

    ResourceKeyMaxTTLInvalidation
    Organization ConfigorgId1005mNone (read-only)

    Next steps

    • Would you like me to apply the Set optimization and Intl hoisting now?
    • Should I add lru-cache to handle the Organization Config memoization?
    • Shall I run a dead-code check on the supporting utils/formatters.ts file?

    Connects securely to your tools. The creator never sees your data.

    About this skill

    High-level performance audits for JavaScript and TypeScript projects often get bogged down in subjective style debates or micro-benchmarks that don't matter. This skill delivers a cold-blooded technical review focused exclusively on runtime speed and infrastructure cost. It identifies the O(n^2) bottlenecks, memory leaks, and unnecessary allocations that actually impact your production metrics.

    What it does

    • Runtime Profiling identifies algorithmic inefficiencies like linear scans in loops that should be using Map or Set lookups.
    • Memory Optimization flags unnecessary object spreads, deep copies, and chained array transformations that spike GC pressure.
    • Concurrency Audits finds sequential await calls that can be parallelized or bounded to prevent resource exhaustion.
    • Dead Code Detection locates unreferenced files and unused dependencies that bloat bundles and slow down cold starts.
    • Memoization Strategy suggests specific caching patterns using lru-cache for frequent, expensive data fetches.

    How it works

    1. Define the Goal by selecting either speed (latency-focused for frontend) or cost (compute-focused for backend/serverless).
    2. Scan Hot Paths to prioritize code executed per request, per frame, or over large data collections.
    3. Analyze & Audit for specific anti-patterns like delete on hot objects or unbounded Promise.all calls.
    4. Generate Report with findings ranked by impact (High/Medium/Low) and risk of regression.
    5. Apply Edits one by one upon request, verifying that behavior remains identical to the original implementation.

    Frameworks & tools

    Works across the JS/TS ecosystem including Node.js, browser environments, and serverless handlers. Integrates with Knip for dead code analysis and lru-cache for memoization.

    Why this beats prompting it yourself

    Generic prompts often suggest "cleaner" code that is actually slower or triggers V8 dictionary mode. This skill uses specific heuristics measured on modern runtimes to ensure every suggestion removes actual work without changing the public API.

    Use cases

    • Auditing a Node.js API to reduce p99 latency and CPU usage.
    • Reviewing a React/frontend codebase to trim bundle size and reduce main-thread blocking.
    • Fixing memory leaks in long-running worker processes or CLI tools.
    • Optimizing data transformation pipelines that handle large JSON datasets.

    Known limitations

    Does not perform live benchmarking unless explicitly requested with specific environment setup. Optimization rules are tuned for V8 runtimes.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 17 days ago

    Software
    Node.jsknip

    Permissions

    Read Files
    Network Access
    Write Files
    Listed17 days ago

    What's inside

    Creator

    Tiago Bértolo

    Tiago Bértolo

    Frequently Asked Questions

    This skill is optimized for all JavaScript and TypeScript environments, including Node.js backends, React/Vue frontends, and serverless runtimes like AWS Lambda or Vercel, with specific heuristics tuned for the V8 engine.

    Unlike general-purpose coding assistants, this skill focuses strictly on runtime efficiency and infrastructure costs, avoiding subjective style changes to target O(n^2) bottlenecks and V8-specific optimizations like avoiding dictionary mode.

    You will receive a categorized report ranking findings by performance impact and regression risk, along with the ability to request one-by-one automated refactors for identified hot paths.

    While it identifies algorithmic waste and memory leaks in the code, it does not perform live production benchmarking unless you provide a specific environment and test suite for it to analyze.

    The skill includes native integrations for Knip to detect dead code and lru-cache for implementing efficient memoization strategies, ensuring all recommendations use industry-standard libraries.

    New in LLM Ops

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.