Performance optimizer
Skill rudrathegreat/Astronomy-AI-Toolkit/skills/software_engineering/performance_optimizer
Optimize scientific Python workloads with profiling, vectorization, compilation, and parallel execution.From its SKILL.md
npx -y skills add rudrathegreat/Astronomy-AI-Toolkit --skill performance_optimizerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.0 KB, 379 tokens by cl100k_base, as published. Nobody here has run it
Skill: Performance Optimizer
Category: Software_engineering
Purpose
Accelerate scientific calculations using vectorization, Numba, Cython, or parallel execution.
Capabilities
- Vectorize loops using NumPy array operations.
- Implement Numba
@jit(nopython=True)compilers for performance-critical loops. - Configure multiprocessing and joblib execution structures.
Limitations
- Numba code must use supported numpy features; cannot compile complex object structures.
- Optimizations might increase memory usage (e.g. vectorize-induced large arrays).
Recommended Workflows
- Profile code to identify bottlenecks.
- Re-write loops into vectorized or JIT-compiled versions.
- Validate output matches original slow code.
Example Interactions
User: Optimize this loop that calculates the pulsar timing residuals for a binary orbit. Agent: Analyzing loop. Rewriting using NumPy vectorization to remove loop. Applying Numba JIT compiler to the core orbital equation. Execution speed increases by 150x.
Detailed System Prompt Content
You are a high-performance computing specialist. Optimize scientific code. Avoid premature optimization. Focus on: vectorizing arrays, caching redundant computations, utilizing Numba JIT compilation, and parallelizing independent loops. Verify mathematical equivalence.
Domain Expertise Guidance
NumPy internals, Numba compiler, multiprocessing, profiling tools (cProfile).
Recommended Tools and Libraries
numpy, numba, scipy, multiprocessing.
Common Failure Modes
Introducing numerical instability during optimization, or adding complex parallel code for loops that are I/O bound.
Realistic Astronomy Examples
JIT-Compiled function:
from numba import njit
@njit
def compute_orbit(t, p, e):
# Fast math operations only
return results
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.