Experimental allocation profiler tracking memory allocations at guest-language level. Shows allocation sites, object types, and memory pressure patterns. Use to identify allocation-heavy locations, find unnecessary object creation, and understand memory behavior. High allocations in hot loops = optimization opportunity if escape analysis isn't eliminating them. (project)
Tracks memory allocations at guest-language level to identify allocation-heavy locations and unnecessary object creation.
/plugin marketplace add antonykamp/cc-truffle-performance-plugin/plugin install antonykamp-cc-truffle-performance-plugin@antonykamp/cc-truffle-performance-pluginThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Experimental allocation profiler tracking memory allocations at the guest-language level. Identifies allocation-heavy locations and unnecessary object creation.
Note: High allocations in hot loops = optimization opportunity if escape analysis isn't eliminating them.
# Basic memory tracing
<launcher> --memtracer <program>
# With stack traces
<launcher> --memtracer --memtracer.TraceStackTraces=true <program>
# Filter by allocation count
<launcher> --memtracer --memtracer.TraceMem=1000 <program>
Before running:
<launcher> --memtracer -c 'var a = 👉1, 2, 3👈;' → Verify shows allocationsAfter running:
tool-outputs/memtracer-[benchmark].txtGate: All boxes checked? → Proceed to analysis
| Option | Description |
|---|---|
--memtracer | Enable memory tracer |
--memtracer.TraceStackTraces=true | Include allocation stack traces |
--memtracer.TraceMem=<bytes> | Filter by minimum allocation |
--memtracer.Output=json | JSON output format |
--memtracer.OutputFile=<file> | Save to file |
Memory Tracer. Recorded 45678 allocations.
Source Location || Count || Size || Type
queens.lox:42 || 50000 || 400KB || LoxArray
queens.lox:55 || 25000 || 200KB || LoxObject
| Pattern | Status | Action |
|---|---|---|
| Few allocations in hot path | ✅ Good | Escape analysis working |
| Many allocations in hot loop | ⚠️ Problem | Objects escaping |
| Allocations only in cold path | ✅ OK | Expected behavior |
If hot loop shows many allocations:
queens.lox:42 || 50000 allocations
Cause: Creating arrays inside hot loop Fix: Reuse arrays, or ensure they're eliminated by EA
Point creation || 100000 allocations
Cause: Temporary objects not eliminated Fix: Keep objects local, avoid escaping references
| Finding | Next Skill |
|---|---|
| High allocations | analyzing-compiler-graphs (check EA) |
| Unclear source | Add stack traces |
| Performance issue | profiling-with-cpu-sampler |
profiling-with-cpu-sampler - Time-based profilinganalyzing-compiler-graphs - Check escape analysisdetecting-performance-warnings - Find barriersestablishing-benchmark-baseline - Set expectations<launcher> --help:memtracer
This skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.