rust-profiling

Profile Rust code CPU bottlenecks using the samply CLI tool.

17|Updated May 24, 2014
One-click install
npx skills add https://github.com/blacktop/dotfiles --skill rust-profiling-blacktop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-profiling
Source: https://github.com/blacktop/dotfiles/tree/main/ai/skills/rust-profiling
Command: npx skills add https://github.com/blacktop/dotfiles --skill rust-profiling-blacktop

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps identify and fix performance bottlenecks in Rust applications by profiling their CPU usage.

Core Features & Use Cases

  • CPU Bottleneck Identification: Pinpoint slow functions and code paths.
  • Performance Optimization: Provides data-driven insights before and after optimization efforts.
  • Use Case: When your Rust application is running slower than expected, use this Skill to generate a performance profile and analyze the results to find the exact functions consuming the most CPU time.

Quick Start

Build your Rust project with debug symbols enabled for profiling and then run the samply record command on your binary.

Frequently Asked Questions about rust-profiling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I profile Rust code to find CPU performance bottlenecks?

You can profile Rust code by recording execution with the samply tool to identify CPU performance bottlenecks. This process requires building your project with debug symbols enabled, then running samply record on your binary to analyze slow functions.

Why does my Rust application run slower than expected?

Your Rust application may run slow due to CPU performance bottlenecks. Profiling the execution with samply generates a performance profile that pinpoints the exact functions and code paths consuming the most CPU time.

Do I need debug symbols to profile a Rust binary?

Yes, you need debug symbols to profile a Rust binary effectively. You must configure your Cargo build profiles to include debug symbols before recording with the samply CLI tool for accurate function-level analysis.

What is the best way to optimize Rust performance before and after changes?

The best way to optimize Rust performance is by profiling execution with samply. It provides data-driven insights by recording CPU usage before and after optimization efforts, helping you verify improvements in slow code paths.

Can I use samply to diagnose slow Rust application performance?

Yes, you can use samply to diagnose slow Rust application performance. The samply CLI tool records your binary's execution and analyzes the results to find specific functions consuming the most CPU time.