src/maverick/skills/maverick_python_performance/SKILL.md
Python performance optimization and profiling
npx skillsauth add get2knowio/maverick maverick-python-performanceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Performance optimization patterns and profiling techniques.
# 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)
# 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
# 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)
# 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
import cProfile
import pstats
cProfile.run('my_function()', 'output.prof')
stats = pstats.Stats('output.prof')
stats.sort_stats('cumulative').print_stats(10)
development
Rust unsafe code, FFI, and safety invariants
development
Rust testing patterns (unit, integration, property-based)
development
Rust performance optimization and zero-cost abstractions
development
Rust ownership, borrowing, and lifetimes