/meta-vr:hz-simpleperf-debugfrom meta-vr
Profiles Meta VR and Horizon OS application CPU performance using simpleperf — workload classification, CPU hotspot recording, kernel overhead measurement. Use when diagnosing whether an app is CPU-bound, memory-bound, or I/O-bound on Meta VR devices.
Ships in meta-vr. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill when you need hardware-level CPU performance insights on Meta VR devices:
This skill complements hz-perfetto-debug. Perfetto shows what your app is doing over time. Simpleperf shows where the CPU is spending hardware cycles — cache misses, branch mispredictions, and instruction throughput that Perfetto can't see.
Meta VR devices run on mobile ARM SoCs with strict thermal and power budgets. CPU-bound apps hit frame drops when:
| Refresh Rate | CPU Frame Budget | Notes |
|---|---|---|
| 120 Hz | 8.3 ms | Tight — simpleperf critical for finding hotspots |
| 90 Hz | 11.1 ms | Default target for most apps |
| 72 Hz | 13.9 ms | Fallback for heavier apps |
Simpleperf's hardware counters reveal bottlenecks invisible to software tracing.
Simpleperf profiling is powered by the metavr CLI — install the standalone binary on your PATH (see the metavr-cli skill), or invoke via npx with no install:
metavr --version
Examples below use the bare metavr command; if you use the npm distribution, prefix with npx -y. Connect your Meta VR device via USB with developer mode enabled.
Before optimizing, determine the bottleneck type:
# Classify the foreground app's workload (10-second sample)
metavr perf simpleperf classify
# Target a specific app
metavr perf simpleperf classify --app com.example.myapp
# Custom duration
metavr perf simpleperf classify --duration 15
Returns a classification with evidence:
| Classification | Indicator | Optimization Strategy |
|---|---|---|
| CPU-bound | High IPC, low stall ratio | Optimize algorithms, reduce draw calls, batch work |
| Memory-bound | High stall ratio (stalled-cycles-backend / cpu-cycles) | Reduce cache misses, improve data locality, shrink working set |
| I/O-bound | High context switches per second | Reduce blocking I/O, use async, minimize thread contention |
Capture a CPU cycle profile to find the most expensive functions:
# Record CPU hotspots for the foreground app
metavr perf simpleperf record
# Custom frequency and duration
metavr perf simpleperf record --frequency 4000 --duration 10
# Target a specific app
metavr perf simpleperf record --app com.example.myapp
The recording samples CPU cycles at the specified frequency (default 4000 Hz) and generates a profile showing which functions consume the most CPU time.
Determine how much CPU time is spent in kernel vs userspace per thread:
# Measure kernel overhead for the foreground app
metavr perf simpleperf kernel-overhead
# Custom duration
metavr perf simpleperf kernel-overhead --app com.example.myapp --duration 10
Returns per-thread breakdown of user-mode vs kernel-mode CPU cycles. High kernel overhead (>20%) in a thread suggests:
Always start with classification. This prevents wasting time optimizing the wrong thing.
metavr perf simpleperf classify --app com.example.myapp --duration 10
Decision tree based on results:
metavr perf simpleperf record --app com.example.myapp --duration 10
Review the top functions by CPU cycle consumption. Common VR hotspots:
| Function Pattern | Likely Cause | Fix |
|---|---|---|
Physics.* / PhysX | Complex physics simulation | Reduce collider count, simplify meshes, increase fixed timestep |
Render* / Draw* | Too many draw calls | Batch materials, use GPU instancing, reduce unique materials |
GC_* / gc_alloc | Garbage collection pressure | Pool allocations, avoid per-frame allocations |
memcpy / memmove | Large data copies | Use references, reduce buffer sizes, avoid unnecessary copies |
LZ4_* / compress | Asset decompression | Pre-decompress, use lighter compression, cache results |
If classification shows memory-bound, the issue is likely cache misses or memory bandwidth:
Use Perfetto hz-perfetto-debug to correlate memory-bound regions with specific code paths.
metavr perf simpleperf kernel-overhead --app com.example.myapp
Interpreting results by thread:
| Thread | Expected Kernel % | High Kernel % Indicates |
|---|---|---|
| Main/Game thread | < 5% | Excessive file I/O, logging, or allocations |
| Render thread | 5-15% | Normal (GPU driver overhead). >20% = driver issue |
| Worker threads | < 5% | Thread synchronization overhead |
| Audio thread | < 10% | Normal for audio HAL calls |
Simpleperf tells you where cycles go. Perfetto tells you when and in what context. Use together:
metavr perf capture) shows when those functions run relative to frame boundariesmetavr perf query to correlate function timing with frame dropsmetavr device info.adb shell simpleperf fails, ensure developer mode is enabled and USB debugging is authorized.For detailed guides on specific topics, see:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
meta-vr, horizon-os, simpleperf, cpu-profiling, performance-analysis, quest
npx claudepluginhub meta-quest/agentic-tools --plugin meta-vr36 skills in this plugin
/hz-android-2d-portingGuides porting existing Android 2D apps to Meta VR and Horizon OS — input adaptation, panel layout, and design requirements. Use when adapting a mobile Android app for Meta VR. For UI design decisions, use hz-panel-designer if available. Build path: Standard Android; use hz-quest-verify-first if the build path is unclear./hz-api-upgradeUpgrades Meta VR apps to newer Horizon OS SDK versions — migration guides, deprecated API replacements, changelog. Use when updating SDK versions or fixing deprecated API warnings. Build paths: all Meta VR app stacks; use hz-quest-verify-first if the build path is unclear./hz-immersive-designerGuides design of comfortable, intuitive VR/MR experiences for Meta VR and Horizon OS — comfort guidelines, interaction patterns, spatial layout, accessibility. Use during UX design review or when evaluating comfort and accessibility. Build paths: Meta Spatial SDK, Unity, Unreal, native OpenXR, and WebXR; for 2D panel apps use hz-panel-designer if available. Use hz-quest-verify-first if the build path is unclear./hz-iwsdk-webxrBuilds WebXR experiences for Meta VR and Horizon OS using the Immersive Web SDK (IWSDK) — ECS architecture, Three.js integration, spatial UI. Use when creating web-based VR/MR apps for Quest Browser./hz-metavrx-layout-sdkBuild multi-window Meta Horizon OS experiences with the MetaVrx Layout SDK in Jetpack Compose or React Native. Covers framework selection, setup, anchoring, semantic offsets, window promotion, fallback, priority, lifecycle, and theming. Use for apps that need multiple app-owned panels without an immersive scene. Build path: Standard Android, including React Native; use hz-quest-verify-first if the path is unclear, and do not use this skill for immersive Spatial SDK scenes./hz-metavrx-ui-setBuilds app UI for Meta VR and Horizon OS with the MetaVrx UI Set, a Jetpack Compose component library and design system. Covers UiSetTheme, buttons, cards, controls, dialogs, dropdowns, inputs, side navigation, sliders, tooltips, the Icons.Regular library, Gradle setup, and migration from the Spatial SDK UI Set. Build path: Standard Android; use hz-quest-verify-first if the path is unclear.Other plugins' skills for the same job