jpskill.com
📦 その他 コミュニティ

profiling-optimization

Profile application performance, identify bottlenecks, and optimize hot paths using CPU profiling, flame graphs, and benchmarking. Use when investigating performance issues or optimizing critical code paths.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o profiling-optimization.zip https://jpskill.com/download/21495.zip && unzip -o profiling-optimization.zip && rm profiling-optimization.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/21495.zip -OutFile "$d\profiling-optimization.zip"; Expand-Archive "$d\profiling-optimization.zip" -DestinationPath $d -Force; ri "$d\profiling-optimization.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して profiling-optimization.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → profiling-optimization フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
8

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

プロファイリングと最適化

目次

概要

コード実行をプロファイルし、データ駆動型のアプローチを使用してパフォーマンスのボトルネックを特定し、クリティカルパスを最適化します。

使用場面

  • パフォーマンス最適化
  • CPUボトルネックの特定
  • ホットパスの最適化
  • 遅いリクエストの調査
  • レイテンシーの削減
  • スループットの向上

クイックスタート

最小限の動作例:

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

    try {
      return await fn();
    } finally {
// ... (完全な実装についてはリファレンスガイドを参照してください)

リファレンスガイド

references/ ディレクトリ内の詳細な実装:

ガイド 内容
Node.js Profiling Node.js プロファイリング
Chrome DevTools CPU Profile Chrome DevTools CPU プロファイル
Python cProfile Python cProfile
Benchmarking ベンチマーキング
Database Query Profiling データベースクエリのプロファイリング
Flame Graph Generation フレームグラフの生成

ベストプラクティス

✅ DO

  • 最適化の前にプロファイルする
  • ホットパスに焦点を当てる
  • 変更の影響を測定する
  • 本番に近いデータを使用する
  • メモリと速度のトレードオフを考慮する
  • 最適化の根拠を文書化する

❌ DON'T

  • プロファイリングなしに最適化する
  • わずかな改善のために可読性を無視する
  • ベンチマーキングを省略する
  • コールドパスを最適化する
  • 測定なしに変更を加える
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

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

    try {
      return await fn();
    } finally {
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

Guide Contents
Node.js Profiling Node.js Profiling
Chrome DevTools CPU Profile Chrome DevTools CPU Profile
Python cProfile Python cProfile
Benchmarking Benchmarking
Database Query Profiling Database Query Profiling
Flame Graph Generation Flame Graph Generation

Best Practices

✅ DO

  • Profile before optimizing
  • Focus on hot paths
  • Measure impact of changes
  • Use production-like data
  • Consider memory vs speed tradeoffs
  • Document optimization rationale

❌ DON'T

  • Optimize without profiling
  • Ignore readability for minor gains
  • Skip benchmarking
  • Optimize cold paths
  • Make changes without measurement

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。