What problem does it solve?
OCaml developers often struggle to understand where allocations and boxing occur, hindering performance improvements. This Skill provides a structured approach to instrument code with memtrace to reveal allocation hotspots and guide targeted optimizations.
Core Features & Use Cases
- Instrument OCaml executables with memtrace to capture allocation traces.
- Run targeted benchmarks to isolate hotspots, boxing overhead, and function hot paths.
- Identify hotspot locations and validate optimizations with before/after comparisons.
- Visualize traces with memtrace-viewer or hotspot tooling to drive data-informed improvements.
Quick Start
Use Memtrace to instrument your OCaml project: add Memtrace.trace_if_requested () at program startup, build with dune, run with MEMTRACE=trace.ctf, and analyze the resulting trace to locate allocation hotspots.