← 返回
未分类 中文

Nm Parseltongue Python Performance

Python performance profiling and optimization: bottleneck detection, memory tuning, benchmarking
Python性能分析与优化:瓶颈检测、内存调优、基准测试
athola
未分类 clawhub v1.0.2 2 版本 100000 Key: 无需
★ 0
Stars
📥 596
下载
💾 1
安装
2
版本
#latest

概述

> 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

  • 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
  • Troubleshooting

Common Issues

Command not found

Ensure all dependencies are installed and in PATH

Permission errors

Check file permissions and run with appropriate privileges

Unexpected behavior

Enable verbose logging with --verbose flag

版本历史

共 2 个版本

  • v1.0.2 当前
    2026-05-09 16:33 安全 安全
  • v1.0.1
    2026-05-07 05:29 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Nm Attune Project Planning

athola
将规格说明转换为分阶段、依赖排序的实施计划,用于规格说明完成后、执行开始前。
★ 0 📥 611

Nm Abstract Hooks Eval

athola
评估钩子安全性、性能和SDK合规性。用于审计
★ 0 📥 615

Nm Attune Project Init

athola
使用 git、CI/CD 工作流、pre-commit hooks 和构建配置搭建新项目
★ 0 📥 617