← スキル一覧に戻る

profile-engine
by legacy3
⭐ 1🍴 0📅 2026年1月3日
SKILL.md
name: profile-engine description: Profile the Rust simulation engine to identify performance bottlenecks. Use when optimizing engine performance or investigating slow code paths. allowed-tools: Read, Bash, Edit, Grep, Glob
Profile Engine
Profile the Rust simulation engine using profile.py to identify hot paths.
Quick Start
cd ./crates/engine
./profile.py 5000 # Profile with 5000 iterations
./profile.py 10000 --top 30 # More iterations, show top 30 functions
./profile.py --json # Output as JSON for parsing
Prerequisites
cargo install samply
brew install binutils # Optional: better symbol resolution
What profile.py Does
- Builds the engine with debug symbols
- Runs samply profiler on the benchmark binary
- Parses the profile and resolves symbols
- Shows hot modules and functions by self time
Reading the Output
HOT MODULES (by self time)
─────────────────────────────────────────────────────────────────
12.5% █████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ engine::sim::engine
HOT FUNCTIONS (by self time, excluding std/core)
─────────────────────────────────────────────────────────────────
Self Total Function Location
───── ───── ────────────────────────────────────────────────── ────────────
8.2% 45.3% run_simulation engine.rs:123
4.1% 12.5% evaluate_rotation engine.rs:456
- Self time: Time spent in the function itself (optimization target)
- Total time: Time including all called functions
- High self time = hot path to optimize
Current Hot Paths
run_simulation- main simulation loophandle_gcd_ready- GCD event processingevaluate_rotation- spell availability checkscast_spell- spell executionEventQueue::push/pop- priority queue operations
Baseline Performance
- 300s fights, 5000 iterations
- ~0.26M sims/sec (optimized build)
- ~0.22M sims/sec (profiling build with debug symbols)
Advanced Usage
Manual samply (with browser UI)
cd ./crates/engine
RUSTFLAGS="-C force-frame-pointers=yes" cargo build --release
samply record --rate 4000 ./target/release/bench 5000
Opens Firefox Profiler with interactive flame graph.
Production Build Settings
After profiling, ensure production settings in Cargo.toml:
[profile.release]
lto = true
codegen-units = 1
panic = "abort"
Sources
スコア
総合スコア
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
レビュー
💬
レビュー機能は近日公開予定です