joelperf - Performance Profiling Toolchain
joelperf is the command-line tool for performance profiling, optimization, and benchmarking JOEL programs.
Installation
joelperf is included with JOEL:
joelperf --versionQuick Start
# Profile program
joelperf profile app.joel
# Benchmark function
joelperf benchmark app.joel --function main
# Generate flame graph
joelperf flamegraph app.joelProfiling
Profile program execution:
# CPU profiling
joelperf profile app.joel
# Memory profiling
joelperf profile app.joel --memory
# Profile with output
joelperf profile app.joel --output profile.json
# Profile specific function
joelperf profile app.joel --function compute
# Profile with sampling rate
joelperf profile app.joel --sample-rate 1000Benchmarking
Benchmark code performance:
# Benchmark program
joelperf benchmark app.joel
# Benchmark specific function
joelperf benchmark app.joel --function sort
# Benchmark with iterations
joelperf benchmark app.joel --iterations 1000
# Compare benchmarks
joelperf benchmark compare baseline.json optimized.json
# Generate benchmark report
joelperf benchmark app.joel --output report.htmlFlame Graphs
Generate performance visualizations:
# Generate flame graph
joelperf flamegraph app.joel
# Generate from profile
joelperf flamegraph --input profile.json
# Generate interactive flame graph
joelperf flamegraph app.joel --interactive
# Export flame graph
joelperf flamegraph app.joel --output flamegraph.svgMemory Analysis
Analyze memory usage:
# Memory profile
joelperf memory app.joel
# Memory leak detection
joelperf memory app.joel --leak-check
# Memory allocation tracking
joelperf memory app.joel --track-allocations
# Generate memory report
joelperf memory app.joel --output memory.jsonOptimization Analysis
Analyze optimization opportunities:
# Analyze hot paths
joelperf analyze app.joel --hot-paths
# Identify bottlenecks
joelperf analyze app.joel --bottlenecks
# Suggest optimizations
joelperf optimize app.joel --suggest
# Compare before/after
joelperf compare before.json after.jsonExamples
Profile and Analyze
# Profile execution
joelperf profile app.joel --output profile.json
# Analyze results
joelperf analyze profile.json
# Generate flame graph
joelperf flamegraph --input profile.jsonBenchmark Comparison
# Benchmark baseline
joelperf benchmark baseline.joel --output baseline.json
# Benchmark optimized
joelperf benchmark optimized.joel --output optimized.json
# Compare results
joelperf compare baseline.json optimized.jsonCommand Reference
Profiling Commands
joelperf profile <file>- Profile programjoelperf profile <file> --memory- Memory profilingjoelperf profile <file> --cpu- CPU profiling
Benchmarking Commands
joelperf benchmark <file>- Benchmark programjoelperf benchmark <file> --function <name>- Benchmark functionjoelperf benchmark compare <file1> <file2>- Compare benchmarks
Analysis Commands
joelperf analyze <file>- Analyze performancejoelperf flamegraph <file>- Generate flame graphjoelperf memory <file>- Memory analysis