agents/skills/workflow-perf/SKILL.md
Use this skill when tasked with improving the performance or memory usage of a workload in V8. This workflow focuses on identifying bottlenecks and applying V8-side optimizations.
x64.release-baseline for better gm.py integration. This avoids recompiling at later stages.For performance analysis, you do NOT need to create a full implementation_plan.md until you are actually fixing the performance issue you've detected. Instead, maintain an Analysis Plan (e.g., in task.md or as a list of questions to answer) to guide the investigation.
Initialize the following tracks concurrently:
--probe=profiling for full-browser or d8 profiles--probe=perfetto for detailed perfetto traces--probe=v8.log for extracting internal v8 logs from chromeIn the jetski environment, you can also use the jsb_run_bench tool from v8-utils as an alternative for quick runs.
jsb_run_bench with paths to d8 binaries to compare performance.record: "perf" and record: "v8log".For peak performance, it is often necessary to inspect the intermediate representations (IR) of the optimizing compiler (TurboFan or Turboshaft).
d8 --trace-turbo script.js or pass flags in Crossbench/jsb_run_bench. This generates JSON files containing the graph state at various optimization phases (e.g., turbo-*.json).go/turbolizer or in the V8 repository under tools/turbolizer).Beyond hotspots, look for areas where V8 can be improved to handle patterns better:
--log-ic shows frequent misses, pivot to investigating object layout and stabilizing hidden classes.scripts/upload_and_pinpoint.py \
--benchmark=<benchmark_name> \
--bot=<bot_name> \
--message="Experiment: My performance optimization"
./cb.py pinpoint help to understand the available options.perf stats (cycles, instructions).