Explains compiler optimization failures in Rust code. Trace analyzes your project and surfaces missed vectorizations, failed inlining, unnecessary bounds checks, and other performance issues directly in your editor.
Features
Inline Diagnostics — Squiggly underlines on lines with performance issues, color-coded by severity (warning, info, hint).
Hover Cards — Hover over a diagnostic to see the issue type, performance impact, root cause, evidence from the compiler, and suggested fixes.
Tree View — A dedicated "Trace" panel in the activity bar groups issues by type with counts and lets you click to navigate to the source location.
CLI Management — Automatically downloads and verifies the Trace CLI binary from GitHub Releases. Supports custom CLI paths.
One-Command Analysis — Run Trace: Analyze Project to generate .trace/ artifacts without leaving the editor.
Getting Started
Install the extension.
Open a Rust project in VS Code.
Run the command Trace: Analyze Project (Generate .trace) from the Command Palette (Cmd+Shift+P).
Issues appear as inline diagnostics and in the Trace side panel.
The extension activates automatically when it detects a Rust file or an existing .trace/issues.json in your workspace.
Commands
Command
Description
Trace: Analyze Project (Generate .trace)
Run trace build on the current workspace
Trace: Refresh Issues
Re-read .trace/ artifacts and update diagnostics
Trace: Setup (Install CLI)
Force-install the Trace CLI from GitHub
Trace: Install/Update CLI
Manually trigger a CLI download
Configuration
All settings live under the trace.* namespace.
Setting
Default
Description
trace.artifactPath
.trace
Path to the Trace artifact directory
trace.showInlineHints
true
Show inline diagnostics for performance issues
trace.onlyProjectFiles
true
Hide issues from stdlib/toolchain sources
trace.cliPath
(empty)
Custom path to the Trace CLI binary
trace.cliAutoInstall
true
Auto-download the CLI when needed
trace.cliRepo
nurozen/trace
GitHub repo for CLI releases
trace.cliReleaseTag
cli-main
GitHub release tag to download from
trace.analyzeRelease
true
Pass --release to trace build
trace.analyzeCargoArgs
[]
Extra arguments forwarded to cargo
Issue Types
Trace detects the following optimization failures:
Type
Description
Missed Vectorization
Loop that could use SIMD but doesn't
Missed Inlining
Function call that the compiler chose not to inline
Bounds Checks
Array/slice access with redundant bounds checking
Aliasing
Pointer aliasing preventing optimizations
Hot-Path Allocation
Heap allocation on a performance-critical path
Unpredictable Branches
Branch patterns that defeat CPU prediction
How It Works
trace build compiles your project while capturing LLVM optimization remarks.
The CLI processes these remarks into structured issues written to .trace/issues.json.
The extension watches .trace/ for changes and maps issues to VS Code diagnostics.
A mapping file (.trace/mapping.json) enables O(1) lookup by file and line.
Development
npm install
npm run compile # build once
npm run watch # rebuild on change
npm run lint # run eslint
npm run test # run tests
Requirements
VS Code 1.85+
A Rust project with Cargo
macOS (x64/arm64), Linux (x64/arm64), or Windows (x64)