Js Performance Patterns

Provides framework-agnostic JavaScript runtime performance patterns. Use when optimizing hot paths, loops, DOM operations, caching, or data structure choices in performance-critical code.

259 stars 28 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add PatternsDev/skills --skill js-performance-patterns
Manual install
git clone --depth 1 https://github.com/PatternsDev/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/javascript/js-performance-patterns ~/.claude/skills/js-performance-patterns

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# JavaScript Performance Patterns

## Table of Contents

- [When to Use](#when-to-use)
- [Instructions](#instructions)
- [Details](#details)
- [Source](#source)

Runtime performance micro-patterns for JavaScript hot paths. These patterns matter most in tight loops, frequent callbacks (scroll, resize, animation frames), and data-heavy operations. They apply to any JavaScript environment — React, Vue, vanilla, Node.js.

## When to Use

Reference these patterns when:
- Profiling reveals a hot function or tight loop
- Processing large datasets (1,000+ items)
- Handling high-frequency events (scroll, mousemove, resize)
- Optimizing build-time or server-side scripts
- Reviewing code for performance in critical paths

## Instructions

- Apply these patterns only in **measured hot paths** — code that runs frequently or processes large datasets. Don't apply them to cold code paths where readability is more important than nanosecond gains.

## Details

### Overview

Micro-optimizations are **not** a substitute for algorithmic improvements. Address the algorithm first (O(n^2) to O(n), removing waterfalls, reducing DOM mutations). Once the algorithm is right, these patterns squeeze additional performance from hot paths.

---

### 1. Use `Set` and `Map` for Lookups

**Impact: HIGH for large collections** — O(1) vs O(n) per lookup.
Read the full skill on GitHub

Details

Skill name
js-performance-patterns
Path
javascript/js-performance-patterns/SKILL.md
Repo updated
15 April 2026

FAQ

What does the Js Performance Patterns skill do?

Provides framework-agnostic JavaScript runtime performance patterns. Use when optimizing hot paths, loops, DOM operations, caching, or data structure choices in performance-critical code.

How do I install the Js Performance Patterns skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add PatternsDev/skills --skill js-performance-patterns. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Js Performance Patterns popular?

It lives in PatternsDev/skills, which has 259 GitHub stars and 28 forks.

Related skills

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.