lading-optimize-find-target
БесплатноЗапускает вложенные скриптыНе проверенFinds a valid optimization target in lading. Returns a filled target.yaml template with pattern, technique, target, file, bench, and fingerprint. Use before…
от DataDog★ 101 звезда на GitHubОб этом скилле
Phase 1: Discover Benchmark-Eligible Modules
A module is eligible if it has a Criterion benchmark in lading_payload/benches/.
- List benchmarks: Glob
lading_payload/benches/*.rs— each filename (minus.rs) is a bench name - Resolve sources: For each bench name, find the corresponding source file(s) under
lading_payload/src/. Check single-file modules ({name}.rs), directory modules ({name}/), and parent-module patterns (e.g.,opentelemetry_log→opentelemetry/log.rs) - Match fingerprints: Glob
ci/fingerprints/*/lading.yaml— each directory name is a fingerprint. Match fingerprints to modules by reading thevariant:key from each config
The result is a set of (bench, source_files, fingerprint_or_none) triples.
Phase 2: Profile Allocation Intensity
Run the profiling script:
.claude/skills/lading-optimize-find-target/scripts/profile-modules
Output is TSV: module, allocations, total_bytes, peak_live_bytes. Record per-module.
Phase 3: Learn from Past Optimizations
Read the optimization history to understand what techniques work and what's already done:
Read .claude/skills/lading-optimize-hunt/assets/db.yaml
For each entry, read its detail file (file: field, relative to .claude/skills/lading-optimize-hunt/) to extract:
- Technique and measurements — which techniques yielded what % improvements
- Lessons — what patterns were optimized and what the before/after looked like
- Targets already covered — so you skip them
This history teaches you what to look for. Successful past techniques are strong signals for where to look next. The lessons field often suggests next targets explicitly.
Phase 4: Find Opportunities
Scan every benchmark-eligible source module for every known pattern below. This is an exhaustive cross-product — do not short-circuit after finding one hit.
Known Patterns
| Name | Pattern | Technique |
|---|---|---|
vec-with-capacity |
Vec::new() + repeated push |
Vec::with_capacity(n) |
string-with-capacity |
String::new() + repeated push |
String::with_capacity(n) |
map-with-capacity |
FxHashMap::default() hot insert |
FxHashMap::with_capacity(n) |
buffer-reuse |
format!() in hot loop |
write!() to reused buffer |
slice-params |
&Vec<T> or &String parameter |
&[T] or &str slice |
hoist-allocation |
Allocation in hot loop | Move allocation outside loop |
object-pool |
Repeated temp allocations | Object pool / buffer reuse |
borrow-not-clone |
Clone where borrow works | Use reference |
inline |
Hot cross-crate fn call | #[inline] attribute |
lazy-iterators |
Intermediate .collect() calls |
Iterator chains without collect |
box-large-structs |
Large struct by value | Box or reference |
bounded-buffer |
Unbounded growth | Bounded buffer with .clear() |
scratch-buffer |
encode_to_vec() per call |
Reusable BytesMut scratch buffer |
on-demand-serialization |
Deep clone of template in loop | Incremental mutation / COW |
Procedure (must follow exactly)
Step 1 — Read source files. For each module's source file(s), Read the full file (excluding #[cfg(test)] blocks). Understand the data flow: what structs exist, how serialization works, where the hot path is, and what allocations occur.
Step 2 — Identify patterns. For each module, check whether any of the Known Patterns above apply. Record a hit matrix:
module × pattern → match count (0 = no hit)
Show the full matrix as a table. Every cell must have a value. Do NOT skip any combination.
Step 3 — Record opportunities. Each verified hot-path hit becomes an opportunity:
(pattern, technique, target_function, file, module, allocations_from_profiling)
Phase 5: Filter
Remove any opportunity that:
- Already in
.claude/skills/lading-optimize-hunt/assets/db.yaml— same function + semantically equivalent technique already exists - No benchmark — module has no matching bench file in
lading_payload/benches/
If zero survive, STOP: "No valid optimization targets found."
Phase 6: Rank
Sort by two dimensions:
- Technique impact — techniques with measured history in
.claude/skills/lading-optimize-hunt/assets/db.yamlrank higher (compute avg % improvement frommeasurements.benchmarks.macro). Unknown techniques rank last. - Allocation intensity — modules with higher allocation counts from profiling r
Установить lading-optimize-find-target в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadGlobGrepВложенные файлы
FAQ
Что делает скилл lading-optimize-find-target?
Finds a valid optimization target in lading. Returns a filled target.yaml template with pattern, technique, target, file, bench, and fingerprint. Use before /lading-optimize-hunt or when selecting a new optimization target.
Как установить скилл lading-optimize-find-target?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл lading-optimize-find-target запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic