rjprof-cli-0.1.0 is not a library.
rjprof
(Rust-Java profiler), similar to async-profiler.
Quick Start
# Build everything
# Quick test with Hello World
# Test with Spring Boot application (builds and runs automatically)
# Profile your own JAR
Project Structure
This project uses a Cargo workspace with two main components:
librjprof/
- Core profiling library using JVMTIrjprof-cli/
- Command-line interface and toolsexamples/
- Sample applications for testing
Building
Simple Build (Recommended)
Manual Build
Requirements
- Rust (latest stable)
- Java Development Kit (JDK 8+) with
JAVA_HOME
set - Maven (for Spring demo)
- Optional: flamegraph.pl or inferno-flamegraph for SVG generation
🔧 Usage
Basic Profiling
# Profile any JAR file
# Profile with Spring filtering (removes framework noise)
# Focus on user code only
# Filter by performance thresholds
Advanced Options
# Custom package filtering
# Different sorting and output options
# Verbose output with flamegraph generation
Profile Modes
all
- Profile everything (can be noisy)user
- Focus on user code, exclude JDK/framework (default)hotspots
- Only methods above performance thresholdsallocation
- Focus on allocation-heavy methods
Makefile Targets
Target | Description |
---|---|
make build |
Build release version |
make dev |
Build debug version (faster) |
make test |
Run all tests |
make run-hello |
Quick test with Hello World |
make run-spring |
Test with Spring Boot demo |
make flamegraph |
Generate SVG from last run |
make clean |
Clean build artifacts |
make help |
Show all available targets |
📊 Features
Smart Filtering
- Spring Boot optimized - Automatically filters common Spring/framework noise
- Custom package filtering - Include/exclude specific packages
- Performance thresholds - Hide methods below time/percentage limits
- Profile modes - Focus on different aspects of performance
Output Formats
- Colorized console output - Easy-to-read performance reports
- JSON export - Machine-readable data
- CSV export - Spreadsheet-compatible format
- Flamegraph generation - Visual performance analysis
Advanced Profiling
- Method entry/exit timing - Precise performance measurement
- Memory allocation tracking - Find allocation hotspots
- Call graph analysis - Understand call relationships
- Sampling support - Low-overhead profiling option
Examples
Profile Spring Boot Application
# Automatic: builds Spring demo and profiles it
# Manual: profile existing Spring JAR
Custom Filtering for Microservice
Memory Allocation Analysis
Flamegraph Generation
Generate visual flamegraphs for performance analysis:
# Run profiler with flamegraph generation
# Or generate from existing data
Flamegraphs are saved to profiler_output/flamegraph.svg
.
Development
Running Tests
Code Quality
Performance Tips
- Use
--mode user
for most applications to focus on your code - Enable
--spring
for Spring Boot apps to reduce noise - Set thresholds with
--min-pct
and--min-total
to hide trivial methods - Generate flamegraphs for visual analysis of performance bottlenecks
- Export to JSON for integration with other analysis tools
Troubleshooting
Agent Not Found
# Manually specify agent path
JAVA_HOME Issues
# Ensure JAVA_HOME is set correctly
# macOS
# Linux
Build Issues
# Clean and rebuild
# Check dependencies
License
Licensed under either of:
- Apache License, Version 2.0
- MIT License