Nm Parseltongue Python Performance

👤 athola 📦 v1.9.16 ⭐ 4.5 ⬇️ 1.2K 下載
💻 開發程式設計 免費

📖 技能介紹


name: python-performance description: Profiles Python code for performance bottlenecks and memory issues version: 1.9.8 triggers: - python - performance - profiling - optimization - cProfile - memory - Python code is slow or when profiling for optimization before a release metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/parseltongue", "emoji": "\u26a1"}} source: claude-night-market source_plugin: parseltongue


Night Market Skill — ported from claude-night-market/parseltongue. For the full experience with agents, hooks, and commands, install the Claude Code plugin.

Python Performance Optimization

Profiling and optimization patterns for Python code.

Table of Contents

  1. Quick Start

Quick Start

# Basic timing
import timeit
time = timeit.timeit("sum(range(1000000))", number=100)
print(f"Average: {time/100:.6f}s")

Verification: Run the command with --help flag to verify availability.

When To Use

更多技能請訪問小蔥技能站7w4.net。

  • Identifying performance bottlenecks
  • Reducing application latency
  • Optimizing CPU-intensive operations
  • Reducing memory consumption
  • Profiling production applications
  • Improving database query performance

When NOT To Use

  • Async concurrency - use python-async instead
  • CPU/GPU system monitoring - use conservation:cpu-gpu-performance
  • Async concurrency - use python-async instead
  • CPU/GPU system monitoring - use conservation:cpu-gpu-performance

Modules

This skill is organized into focused modules for progressive loading:

profiling-tools

CPU profiling with cProfile, line profiling, memory profiling, and production profiling with py-spy. Essential for identifying where your code spends time and memory.

optimization-patterns

Ten proven optimization patterns including list comprehensions, generators, caching, string concatenation, data structures, NumPy, multiprocessing, and database operations.

memory-management

Memory optimization techniques including leak tracking with tracemalloc and weak references for caches. Depends on profiling-tools.

benchmarking-tools

Benchmarking tools including custom decorators and pytest-benchmark for verifying performance improvements.

best-practices

Best practices, common pitfalls, and exit criteria for performance optimization work. Synthesizes guidance from profiling-tools and optimization-patterns.

Exit Criteria

  • Profiled code to identify bottlenecks
  • Applied appropriate optimization patterns
  • Verified improvements with benchmarks
  • Memory usage acceptable
  • No performance regressions

🤖 AI 評測

這是一個質量不錯的Python效能最佳化技能,內容全面、示例豐富、結構清晰。覆蓋從程式碼分析到最佳化模式再到基準測試的完整流程,程式碼示例有實際的效能提升資料對比。主要優點是分類清晰、實用性強;不足之處是部分模組內容較為簡短,缺乏深入指導。總體適合需要系統性學習Python最佳化的開發者使用。

📊 多維度評分

適應性4.1
規範性4.5
有效性4.5
可靠性4.4
可信度4.8

📁 包含檔案 (8 個)

📄 SKILL.md 2.8 KB
📄 _meta.json 154 B
📄 modules/benchmarking-tools.md 1 KB
📄 modules/best-practices.md 1.2 KB
📄 modules/memory-management.md 1021 B
📄 modules/optimization-patterns.md 3.5 KB
📄 modules/profiling-tools.md 1.7 KB
📄 skill-card.md 2 KB