← スキル一覧に戻る

maverick-python-performance
by get2knowio
Highway to the agent zone!
⭐ 0🍴 0📅 2026年1月25日
SKILL.md
name: maverick-python-performance description: Python performance optimization and profiling version: 1.0.0 triggers:
- performance
- optimize
- slow
- profiling
- cProfile
- timeit
- memory
- bottleneck
- comprehension
- generator
Python Performance Skill
Performance optimization patterns and profiling techniques.
List Comprehensions vs Loops
# FAST - list comprehension
squares = [x**2 for x in range(1000)]
# SLOW - append in loop
squares = []
for x in range(1000):
squares.append(x**2)
Generator Expressions (Lazy Evaluation)
# Memory efficient for large datasets
squares = (x**2 for x in range(1_000_000))
# Only compute when needed
for square in squares:
if square > 1000:
break
String Concatenation
# BAD - O(n²) due to string immutability
result = ""
for item in items:
result += str(item) + ","
# GOOD - O(n)
result = ",".join(str(item) for item in items)
Dictionary Lookups
# Use dict.get() with default
value = d.get(key, default_value)
# Use defaultdict for accumulation
from collections import defaultdict
counts = defaultdict(int)
for item in items:
counts[item] += 1
Profiling
import cProfile
import pstats
cProfile.run('my_function()', 'output.prof')
stats = pstats.Stats('output.prof')
stats.sort_stats('cumulative').print_stats(10)
Review Severity
- MAJOR: O(n²) string concatenation in loop
- MINOR: List when generator would suffice
- SUGGESTION: Could use comprehension instead of loop
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です