[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M735MHJ4RG5PPK9QSYHT7NH5":3,"skill-same:01M735MHJ4RG5PPK9QSYHT7NH5":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M735MHJ4RG5PPK9QSYHT7NH5","performance-profiling",null,"Profile and optimize Python\u002FNode.js — cProfile, py-spy, clinic.js, memory profiling, async bottlenecks, DB query analysis","Horonomos-laps\u002FYana-AI","Horonomos-laps","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F355299122?v=4","01M76B3QPXE88ET2SQPDPVATZT"," Horonomos-laps","01M72ZQRJPCYPSSWT4D00VJR2A",13,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperformance-profiling\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: performance-profiling\ndescription: Profile and optimize Python\u002FNode.js — cProfile, py-spy, clinic.js, memory profiling, async bottlenecks, DB query analysis\ntriggers:\n  - performance profiling\n  - profile python\n  - profile nodejs\n  - cprofile\n  - py-spy\n  - memory leak python\n  - memory profiling\n  - slow query analysis\n  - performance bottleneck\n  - async performance\n  - optimize python\ndo_not_use_for:\n  - frontend performance — use web-performance skill\n  - load testing — use k6\u002Flocust\n  - error debugging — use error-handling-patterns\nsee_also:\n  - ai-code-maintainability\n  - logging-observability\n  - web-performance\n---\n\n# Performance Profiling\n\n## Python: cProfile (CPU)\n\n```bash\n# Profile entire script\npython -m cProfile -s cumulative -o profile.prof my_script.py\n\n# Visualize with snakeviz\npip install snakeviz\nsnakeviz profile.prof\n```\n\n```python\nimport cProfile\nimport pstats\nfrom pstats import SortKey\n\n# Profile a specific function\nprofiler = cProfile.Profile()\nprofiler.enable()\nresult = slow_function(data)\nprofiler.disable()\n\nstats = pstats.Stats(profiler)\nstats.sort_stats(SortKey.CUMULATIVE)\nstats.print_stats(20)   # top 20 functions by cumulative time\n```\n\n## Python: py-spy (Production-safe sampling)\n\n```bash\n# Install\npip install py-spy\n\n# Profile running process without restarting\npy-spy top --pid 12345              # live top-style view\npy-spy record -o profile.svg --pid 12345  # flame graph\npy-spy dump --pid 12345             # one-time stack dump\n\n# Profile from start\npy-spy record -o profile.svg -- python my_script.py\n```\n\n## Python: Memory Profiling\n\n```python\n# tracemalloc — built-in, no overhead when not active\nimport tracemalloc\n\ntracemalloc.start()\n# ... run code ...\nsnapshot = tracemalloc.take_snapshot()\ntop_stats = snapshot.statistics(\"lineno\")\nfor stat in top_stats[:10]:\n    print(stat)\n\n# memory-profiler — line-by-line\npip install memory-profiler\nfrom memory_profiler import profile\n\n@profile\ndef process_large_file(path: str) -> None:\n    with open(path) as f:\n        data = f.read()      # see how much memory this line uses\n    process(data)\n```\n\n## Python: Async Bottlenecks\n\n```python\nimport asyncio\nimport time\n\n# Find which coroutine is slow\nasync def timed(coro, label: str):\n    start = time.perf_counter()\n    result = await coro\n    elapsed = time.perf_counter() - start\n    if elapsed > 0.1:   # log slow coroutines\n        print(f\"SLOW [{label}]: {elapsed:.3f}s\")\n    return result\n\n# Profile concurrent tasks\nasync def main():\n    tasks = [\n        timed(fetch_user(uid), f\"fetch_user({uid})\")\n        for uid in user_ids\n    ]\n    results = await asyncio.gather(*tasks)\n\n# Detect event loop blocking\nimport asyncio\n\nasync def detect_blocking(threshold: float = 0.05):\n    \"\"\"Alert if anything blocks the event loop > 50ms.\"\"\"\n    while True:\n        t0 = time.perf_counter()\n        await asyncio.sleep(0)   # yield to event loop\n        elapsed = time.perf_counter() - t0\n        if elapsed > threshold:\n            print(f\"Event loop blocked for {elapsed:.3f}s!\")\n```\n\n## DB Query Analysis\n\n```python\n# SQLAlchemy: log all queries with timing\nimport logging\nlogging.getLogger(\"sqlalchemy.engine\").setLevel(logging.INFO)\n\n# Or use sqlalchemy-utils query profiler\nfrom sqlalchemy_utils import QueryChain\n\nwith QueryChain() as qc:\n    users = session.execute(select(User)).scalars().all()\n\nprint(f\"Queries: {qc.count}, Total: {qc.total_time:.3f}s\")\nfor q in qc.queries:\n    print(f\"  {q.duration:.3f}s — {q.statement[:80]}\")\n\n# EXPLAIN ANALYZE for slow queries (PostgreSQL)\nfrom sqlalchemy import text\n\nresult = session.execute(text(\n    \"EXPLAIN ANALYZE SELECT * FROM users WHERE email = :email\"\n), {\"email\": \"test@example.com\"})\nfor row in result:\n    print(row[0])\n```\n\n## Node.js: clinic.js\n\n```bash\n# Install\nnpm install -g clinic\n\n# Doctor — quick diagnosis\nclinic doctor -- node server.js\n\n# Flame graph — CPU profiling\nclinic flame -- node server.js\n\n# Bubble — event loop delays\nclinic bubbleprof -- node server.js\n```\n\n## Quick Win Checklist\n\n```python\n# 1. Avoid repeated attribute lookups in tight loops\n# ❌ Slow\nfor item in items:\n    result = self.config.timeout * self.config.multiplier   # 2 lookups per iter\n\n# ✅ Cache outside loop\ntimeout = self.config.timeout\nmultiplier = self.config.multiplier\nfor item in items:\n    result = timeout * multiplier\n\n# 2. Use generators for large sequences\n# ❌ Creates entire list in memory\ndata = [transform(x) for x in large_file]\n\n# ✅ Stream processing\ndata = (transform(x) for x in large_file)\n\n# 3. String concatenation in loops\n# ❌ O(n²) — creates new string each iteration\nresult = \"\"\nfor chunk in chunks:\n    result += chunk\n\n# ✅ O(n) — join at end\nresult = \"\".join(chunks)\n\n# 4. Set\u002Fdict lookups vs list membership\n# ❌ O(n) per check\nallowed = [\"admin\", \"editor\", \"viewer\"]\nif role in allowed:\n\n# ✅ O(1) per check\nALLOWED_ROLES = frozenset({\"admin\", \"editor\", \"viewer\"})\nif role in ALLOWED_ROLES:\n```\n\n## Anti-Fake-Pass Checks\n\n- cProfile adds overhead — don't profile micro-benchmarks with it, use `timeit` instead\n- py-spy requires `--sudo` for other user processes on Linux\n- Memory profiler `@profile` decorator slows code significantly — remove in prod\n- `asyncio.gather()` parallelizes I\u002FO, not CPU — use `ProcessPoolExecutor` for CPU-bound\n- \"EXPLAIN ANALYZE\" actually runs the query — don't use on destructive queries\n- Flame graphs show wall clock time — CPU flame graphs only show CPU time, not I\u002FO waits\n","# Performance Profiling\n\n## Python: cProfile (CPU)\n\n```bash\n# Profile entire script\npython -m cProfile -s cumulative -o profile.prof my_script.py\n\n# Visualize with snakeviz\npip install snakeviz\nsnakeviz profile.prof\n```\n\n```python\nimport cProfile\nimport pstats\nfrom pstats import SortKey\n\n# Profile a specific function\nprofiler = cProfile.Profile()\nprofiler.enable()\nresult = slow_function(data)\nprofiler.disable()\n\nstats = pstats.Stats(profiler)\nstats.sort_stats(SortKey.CUMULATIVE)\nstats.print_stats(20)   # top 20 functions by cumulative time\n```\n\n## Python: py-spy (Production-safe sampling)\n\n```bash\n# Install\npip install py-spy\n\n# Profile running process without restarting\npy-spy top --pid 12345              # live top-style view\npy-spy record -o profile.svg --pid 12345  # flame graph\npy-spy dump --pid 12345             # one-time stack dump\n\n# Profile from start\npy-spy record -o profile.svg -- python my_script.py\n```\n\n## Python: Memory Profiling\n\n```python\n# tracemalloc — built-in, no overhead when not active\nimport tracemalloc\n\ntracemalloc.start()\n# ... run code ...\nsnapshot = tracemalloc.take_snapshot()\ntop_stats = snapshot.statistics(\"lineno\")\nfor stat in top_stats[:10]:\n    print(stat)\n\n# memory-profiler — line-by-line\npip install memory-profiler\nfrom memory_profiler import profile\n\n@profile\ndef process_large_file(path: str) -> None:\n    with open(path) as f:\n        data = f.read()      # see how much memory this line uses\n    process(data)\n```\n\n## Python: Async Bottlenecks\n\n```python\nimport asyncio\nimport time\n\n# Find which coroutine is slow\nasync def timed(coro, label: str):\n    start = time.perf_counter()\n    result = await coro\n    elapsed = time.perf_counter() - start\n    if elapsed > 0.1:   # log slow coroutines\n        print(f\"SLOW [{label}]: {elapsed:.3f}s\")\n    return result\n\n# Profile concurrent tasks\nasync def main():\n    tasks = [\n        timed(fetch_user(uid), f\"fetch_user({uid})\")\n        for uid in user_ids\n    ]\n    results = await asyncio.gather(*tasks)\n\n# Detect event loop blocking\nimport asyncio\n\nasync def detect_blocking(threshold: float = 0.05):\n    \"\"\"Alert if anything blocks the event loop > 50ms.\"\"\"\n    while True:\n        t0 = time.perf_counter()\n        await asyncio.sleep(0)   # yield to event loop\n        elapsed = time.perf_counter() - t0\n        if elapsed > threshold:\n            print(f\"Event loop blocked for {elapsed:.3f}s!\")\n```\n\n## DB Query Analysis\n\n```python\n# SQLAlchemy: log all queries with timing\nimport logging\nlogging.getLogger(\"sqlalchemy.engine\").setLevel(logging.INFO)\n\n# Or use sqlalchemy-utils query profiler\nfrom sqlalchemy_utils import QueryChain\n\nwith QueryChain() as qc:\n    users = session.execute(select(User)).scalars().all()\n\nprint(f\"Queries: {qc.count}, Total: {qc.total_time:.3f}s\")\nfor q in qc.queries:\n    print(f\"  {q.duration:.3f}s — {q.statement[:80]}\")\n\n# EXPLAIN ANALYZE for slow queries (PostgreSQL)\nfrom sqlalchemy import text\n\nresult = session.execute(text(\n    \"EXPLAIN ANALYZE SELECT * FROM users WHERE email = :email\"\n), {\"email\": \"test@example.com\"})\nfor row in result:\n    print(row[0])\n```\n\n## Node.js: clinic.js\n\n```bash\n# Install\nnpm install -g clinic\n\n# Doctor — quick diagnosis\nclinic doctor -- node server.js\n\n# Flame graph — CPU profiling\nclinic flame -- node server.js\n\n# Bubble — event loop delays\nclinic bubbleprof -- node server.js\n```\n\n## Quick Win Checklist\n\n```python\n# 1. Avoid repeated attribute lookups in tight loops\n# ❌ Slow\nfor item in items:\n    result = self.config.timeout * self.config.multiplier   # 2 lookups per iter\n\n# ✅ Cache outside loop\ntimeout = self.config.timeout\nmultiplier = self.config.multiplier\nfor item in items:\n    result = timeout * multiplier\n\n# 2. Use generators for large sequences\n# ❌ Creates entire list in memory\ndata = [transform(x) for x in large_file]\n\n# ✅ Stream processing\ndata = (transform(x) for x in large_file)\n\n# 3. String concatenation in loops\n# ❌ O(n²) — creates new string each iteration\nresult = \"\"\nfor chunk in chunks:\n    result += chunk\n\n# ✅ O(n) — join at end\nresult = \"\".join(chunks)\n\n# 4. Set\u002Fdict lookups vs list membership\n# ❌ O(n) per check\nallowed = [\"admin\", \"editor\", \"viewer\"]\nif role in allowed:\n\n# ✅ O(1) per check\nALLOWED_ROLES = frozenset({\"admin\", \"editor\", \"viewer\"})\nif role in ALLOWED_ROLES:\n```\n\n## Anti-Fake-Pass Checks\n\n- cProfile adds overhead — don't profile micro-benchmarks with it, use `timeit` instead\n- py-spy requires `--sudo` for other user processes on Linux\n- Memory profiler `@profile` decorator slows code significantly — remove in prod\n- `asyncio.gather()` parallelizes I\u002FO, not CPU — use `ProcessPoolExecutor` for CPU-bound\n- \"EXPLAIN ANALYZE\" actually runs the query — don't use on destructive queries\n- Flame graphs show wall clock time — CPU flame graphs only show CPU time, not I\u002FO waits\n",{"name":5,"see_also":24,"triggers":28,"description":7,"do_not_use_for":40},[25,26,27],"ai-code-maintainability","logging-observability","web-performance",[29,30,31,32,33,34,35,36,37,38,39],"performance profiling","profile python","profile nodejs","cprofile","py-spy","memory leak python","memory profiling","slow query analysis","performance bottleneck","async performance","optimize python",[41,42,43],"frontend performance — use web-performance skill","load testing — use k6\u002Flocust","error debugging — use error-handling-patterns","main","481dcd7dd2e288b9d627a2bd017db70e64e6c6fa",".claude\u002Fskills\u002Fperformance-profiling",2,"https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI","https:\u002F\u002Fyana.vutam.link\u002F","https:\u002F\u002Fgithub.com\u002FHoronomos-laps","https:\u002F\u002Fyana.vutam.link","An open-source governed runtime & execution environment for multi-agent AI systems.","2026-11-14 13:24:09",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add Horonomos-laps\u002FYana-AI --skill performance-profiling",{"tool":60,"command":61},"bunx","bunx skills add Horonomos-laps\u002FYana-AI --skill performance-profiling",{"tool":63,"command":64},"pnpm","pnpm dlx skills add Horonomos-laps\u002FYana-AI --skill performance-profiling","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperformance-profiling\u002FSKILL.md",true,[],[69,77,84,92,100,108],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M735GKET5YVYKAY62W2P5YXB","openai--sentry--sentry","Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.","MIT","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fopenai--sentry--sentry\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M73DCAP83T17HY7SMGK7MGFE","ito-basket-compare","Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fito-basket-compare\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":88,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M734CYEMZFDR3KH6SW0JP8TD","implementing-network-traffic-baselining","Build network traffic baselines from NetFlow\u002FIPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly\u002Fdaily traffic pattern profiling","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":96,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M73ASZ6NJRJM44Z2P84NGQ3Q","detecting-evasion-techniques-in-endpoint-logs","Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":104,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M734AFNXD06Z78QRK0VKGT7Q","implementing-microsegmentation-with-guardicore","Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":19},"01M736TK27QMCXK0DVCH25SJN5","ramdisk-tmpfs-patterns","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Framdisk-tmpfs-patterns\u002FSKILL.md",[],[]]