Performance Benchmark Specialist Comprehensive performance benchmarking expertise for shell-based tools, focusing on rigorous measurement, statistical analysis, and actionable performance optimization using patterns from the unix-goto project. When to Use This Skill Use this skill when: - Creating performance benchmarks for shell scripts - Measuring and validating performance targets - Implementing statistical analysis for benchmark results - Designing benchmark workspaces and test environments - Generating performance reports with min/max/mean/median/stddev - Comparing baseline vs optimized…

\\n' sorted=($(sort -n \u003c\u003c\u003c\"${values[*]}\"))\n unset IFS\n\n # Min and Max\n local min=${sorted[0]}\n local max=${sorted[$((count-1))]}\n\n # Mean (average)\n local sum=0\n for val in \"${values[@]}\"; do\n sum=$((sum + val))\n done\n local mean=$((sum / count))\n\n # Median (50th percentile)\n local mid=$((count / 2))\n if [ $((count % 2)) -eq 0 ]; then\n # Even number of values - average the two middle values\n local median=$(( (${sorted[$mid-1]} + ${sorted[$mid]}) / 2 ))\n else\n # Odd number of values - take the middle value\n local median=${sorted[$mid]}\n fi\n\n # Standard deviation\n local variance=0\n for val in \"${values[@]}\"; do\n local diff=$((val - mean))\n variance=$((variance + diff * diff))\n done\n variance=$((variance / count))\n\n # Use bc for square root if available, otherwise approximate\n if command -v bc &> /dev/null; then\n local stddev=$(echo \"scale=2; sqrt($variance)\" | bc)\n else\n # Simple approximation without bc\n local stddev=$(awk \"BEGIN {printf \\\"%.2f\\\", sqrt($variance)}\")\n fi\n\n # Return CSV format: min,max,mean,median,stddev\n echo \"$min,$max,$mean,$median,$stddev\"\n}\n\n# Compare two measurements and calculate speedup\nbench_compare() {\n local baseline=\"$1\"\n local optimized=\"$2\"\n\n if [ \"$optimized\" -eq 0 ]; then\n echo \"inf\"\n return\n fi\n\n if command -v bc &> /dev/null; then\n local speedup=$(echo \"scale=2; $baseline / $optimized\" | bc)\n else\n local speedup=$(awk \"BEGIN {printf \\\"%.2f\\\", $baseline / $optimized}\")\n fi\n\n echo \"$speedup\"\n}\n\n# Calculate percentile\nbench_percentile() {\n local percentile=\"$1\"\n shift\n local values=(\"$@\")\n local count=${#values[@]}\n\n IFS=

Performance Benchmark Specialist Comprehensive performance benchmarking expertise for shell-based tools, focusing on rigorous measurement, statistical analysis, and actionable performance optimization using patterns from the unix-goto project. When to Use This Skill Use this skill when: - Creating performance benchmarks for shell scripts - Measuring and validating performance targets - Implementing statistical analysis for benchmark results - Designing benchmark workspaces and test environments - Generating performance reports with min/max/mean/median/stddev - Comparing baseline vs optimized…

\\n' sorted=($(sort -n \u003c\u003c\u003c\"${values[*]}\"))\n unset IFS\n\n local index=$(echo \"scale=0; ($count * $percentile) / 100\" | bc)\n echo \"${sorted[$index]}\"\n}\n\n# ============================================\n# Output Formatting\n# ============================================\n\n# Print formatted header\nbench_header() {\n local title=\"$1\"\n echo \"╔══════════════════════════════════════════════════════════════════╗\"\n printf \"║ %-62s ║\\n\" \"$title\"\n echo \"╚══════════════════════════════════════════════════════════════════╝\"\n echo \"\"\n}\n\n# Print section divider\nbench_section() {\n local title=\"$1\"\n echo \"$title\"\n echo \"─────────────────────────────────────────────────────────────────\"\n}\n\n# Print individual result\nbench_result() {\n local label=\"$1\"\n local value=\"$2\"\n printf \" %-50s %10s\\n\" \"$label:\" \"$value\"\n}\n\n# Print statistics block\nbench_print_stats() {\n local stats=\"$1\"\n local label=\"${2:-Results}\"\n\n IFS=',' read -r min max mean median stddev \u003c\u003c\u003c \"$stats\"\n\n echo \"\"\n echo \"$label:\"\n printf \" Min: %dms\\n\" \"$min\"\n printf \" Max: %dms\\n\" \"$max\"\n printf \" Mean: %dms\\n\" \"$mean\"\n printf \" Median: %dms\\n\" \"$median\"\n printf \" Std Dev: %.2fms\\n\" \"$stddev\"\n}\n\n# Print comparison results\nbench_print_comparison() {\n local baseline_stats=\"$1\"\n local optimized_stats=\"$2\"\n\n IFS=',' read -r b_min b_max b_mean b_median b_stddev \u003c\u003c\u003c \"$baseline_stats\"\n IFS=',' read -r o_min o_max o_mean o_median o_stddev \u003c\u003c\u003c \"$optimized_stats\"\n\n local speedup=$(bench_compare \"$b_mean\" \"$o_mean\")\n local improvement=$(echo \"scale=2; 100 - ($o_mean * 100 / $b_mean)\" | bc)\n\n echo \"\"\n echo \"Performance Comparison:\"\n echo \"─────────────────────────────────\"\n printf \" Baseline mean: %dms\\n\" \"$b_mean\"\n printf \" Optimized mean: %dms\\n\" \"$o_mean\"\n printf \" Speedup: %.2fx\\n\" \"$speedup\"\n printf \" Improvement: %.1f%%\\n\" \"$improvement\"\n}\n\n# ============================================\n# Assertions and Validation\n# ============================================\n\n# Assert performance target is met\nbench_assert_target() {\n local actual=\"$1\"\n local target=\"$2\"\n local label=\"$3\"\n\n if [ \"$actual\" -lt \"$target\" ]; then\n echo \"✓ $label meets target: ${actual}ms (target: \u003c${target}ms)\"\n return 0\n else\n echo \"✗ $label exceeds target: ${actual}ms (target: \u003c${target}ms)\"\n return 1\n fi\n}\n\n# Assert improvement over baseline\nbench_assert_improvement() {\n local baseline=\"$1\"\n local optimized=\"$2\"\n local min_speedup=\"$3\"\n local label=\"${4:-Performance}\"\n\n local speedup=$(bench_compare \"$baseline\" \"$optimized\")\n\n if (( $(echo \"$speedup >= $min_speedup\" | bc -l) )); then\n echo \"✓ $label improved: ${speedup}x (required: >${min_speedup}x)\"\n return 0\n else\n echo \"✗ $label insufficient: ${speedup}x (required: >${min_speedup}x)\"\n return 1\n fi\n}\n\n# ============================================\n# Results Storage\n# ============================================\n\n# Initialize results directory\nbench_init() {\n mkdir -p \"$BENCH_RESULTS_DIR\"\n}\n\n# Save benchmark result to CSV\nbench_save_result() {\n bench_init\n\n local name=\"$1\"\n local stats=\"$2\"\n local operation=\"${3:-}\"\n\n local timestamp=$(date +%s)\n local results_file=\"$BENCH_RESULTS_DIR/results.csv\"\n\n # Create header if file doesn't exist\n if [ ! -f \"$results_file\" ]; then\n echo \"timestamp,benchmark_name,operation,min_ms,max_ms,mean_ms,median_ms,stddev,metadata\" > \"$results_file\"\n fi\n\n # Append result\n echo \"$timestamp,$name,$operation,$stats,\" >> \"$results_file\"\n}\n\n# Load historical results\nbench_load_results() {\n local name=\"$1\"\n local operation=\"${2:-}\"\n\n local results_file=\"$BENCH_RESULTS_DIR/results.csv\"\n\n if [ ! -f \"$results_file\" ]; then\n return 1\n fi\n\n if [ -n \"$operation\" ]; then\n grep \"^[^,]*,$name,$operation,\" \"$results_file\"\n else\n grep \"^[^,]*,$name,\" \"$results_file\"\n fi\n}\n\n# Generate summary report\ngenerate_summary() {\n echo \"\"\n echo \"╔══════════════════════════════════════════════════════════════════╗\"\n echo \"║ Benchmark Complete ║\"\n echo \"╚══════════════════════════════════════════════════════════════════╝\"\n echo \"\"\n echo \"Results saved to: $BENCH_RESULTS_DIR/results.csv\"\n echo \"\"\n}\n\n# ============================================\n# Workspace Management\n# ============================================\n\n# Create test workspace\nbench_create_workspace() {\n local size=\"${1:-medium}\"\n local workspace=$(mktemp -d)\n\n case \"$size\" in\n tiny)\n # 5 folders\n for i in {1..5}; do\n mkdir -p \"$workspace/folder-$i\"\n done\n ;;\n small)\n # 10 folders\n for i in {1..10}; do\n mkdir -p \"$workspace/folder-$i\"\n done\n ;;\n medium)\n # 50 folders\n for i in {1..50}; do\n mkdir -p \"$workspace/folder-$i\"\n done\n ;;\n large)\n # 500 folders\n for i in {1..500}; do\n mkdir -p \"$workspace/folder-$i\"\n done\n ;;\n xlarge)\n # 1000 folders\n for i in {1..1000}; do\n mkdir -p \"$workspace/folder-$i\"\n done\n ;;\n *)\n echo \"Unknown workspace size: $size\"\n rm -rf \"$workspace\"\n return 1\n ;;\n esac\n\n echo \"$workspace\"\n}\n\n# Create nested workspace\nbench_create_nested_workspace() {\n local depth=\"${1:-3}\"\n local breadth=\"${2:-5}\"\n local workspace=$(mktemp -d)\n\n bench_create_nested_helper \"$workspace\" 0 \"$depth\" \"$breadth\"\n\n echo \"$workspace\"\n}\n\nbench_create_nested_helper() {\n local parent=\"$1\"\n local current_depth=\"$2\"\n local max_depth=\"$3\"\n local breadth=\"$4\"\n\n if [ \"$current_depth\" -ge \"$max_depth\" ]; then\n return\n fi\n\n for i in $(seq 1 $breadth); do\n local dir=\"$parent/level${current_depth}-$i\"\n mkdir -p \"$dir\"\n bench_create_nested_helper \"$dir\" $((current_depth + 1)) \"$max_depth\" \"$breadth\"\n done\n}\n\n# Cleanup workspace\nbench_cleanup_workspace() {\n local workspace=\"$1\"\n\n if [ -d \"$workspace\" ] && [[ \"$workspace\" == /tmp/* ]]; then\n rm -rf \"$workspace\"\n else\n echo \"Warning: Refusing to delete non-temp directory: $workspace\"\n fi\n}\n\n# ============================================\n# Utility Functions\n# ============================================\n\n# Check if command exists\nbench_require_command() {\n local cmd=\"$1\"\n\n if ! command -v \"$cmd\" &> /dev/null; then\n echo \"Error: Required command not found: $cmd\"\n exit 1\n fi\n}\n\n# Verify benchmark prerequisites\nbench_verify_env() {\n # Check for required commands\n bench_require_command \"date\"\n bench_require_command \"mktemp\"\n\n # Verify results directory is writable\n bench_init\n if [ ! -w \"$BENCH_RESULTS_DIR\" ]; then\n echo \"Error: Results directory not writable: $BENCH_RESULTS_DIR\"\n exit 1\n fi\n}\n```\n\n### Benchmark Patterns\n\n#### Pattern 1: Cached vs Uncached Comparison\n\n**Purpose:** Measure performance improvement from caching\n\n```bash\n#!/bin/bash\n# Benchmark: Cached vs Uncached Navigation Performance\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nREPO_DIR=\"$SCRIPT_DIR/..\"\n\nsource \"$SCRIPT_DIR/bench-helpers.sh\"\nsource \"$REPO_DIR/lib/cache-index.sh\"\n\nmain() {\n bench_header \"Cached vs Uncached Navigation Performance\"\n\n echo \"Configuration:\"\n echo \" Target folder: unix-goto\"\n echo \" Iterations: 10\"\n echo \" Warmup: 3 runs\"\n echo \"\"\n\n benchmark_cached_vs_uncached\n\n generate_summary\n}\n\nbenchmark_cached_vs_uncached() {\n bench_section \"Benchmark: Cached vs Uncached Lookup\"\n\n # Phase 1: Uncached lookup\n echo \"Phase 1: Uncached lookup (no cache)\"\n echo \"─────────────────────────────────\"\n\n # Remove cache to force uncached lookup\n rm -f \"$HOME/.goto_index\"\n\n # Warmup\n bench_warmup \"find ~/Documents -name unix-goto -type d -maxdepth 5\" 3\n\n # Run benchmark\n local uncached_stats=$(bench_run \"uncached\" \\\n \"find ~/Documents -name unix-goto -type d -maxdepth 5\" 10)\n\n IFS=',' read -r uc_min uc_max uc_mean uc_median uc_stddev \u003c\u003c\u003c \"$uncached_stats\"\n\n bench_print_stats \"$uncached_stats\" \"Uncached Results\"\n\n # Phase 2: Cached lookup\n echo \"\"\n echo \"Phase 2: Cached lookup (with cache)\"\n echo \"─────────────────────────────────\"\n\n # Build cache\n __goto_cache_build\n\n # Warmup\n bench_warmup \"__goto_cache_lookup unix-goto\" 3\n\n # Run benchmark\n local cached_stats=$(bench_run \"cached\" \\\n \"__goto_cache_lookup unix-goto\" 10)\n\n IFS=',' read -r c_min c_max c_mean c_median c_stddev \u003c\u003c\u003c \"$cached_stats\"\n\n bench_print_stats \"$cached_stats\" \"Cached Results\"\n\n # Analysis\n echo \"\"\n bench_print_comparison \"$uncached_stats\" \"$cached_stats\"\n\n # Assert targets\n bench_assert_target \"$c_mean\" 100 \"Cached navigation time\"\n bench_assert_improvement \"$uc_mean\" \"$c_mean\" 5 \"Cache speedup\"\n\n # Save results\n bench_save_result \"cached_vs_uncached\" \"$uncached_stats\" \"uncached\"\n bench_save_result \"cached_vs_uncached\" \"$cached_stats\" \"cached\"\n}\n\nmain\nexit 0\n```\n\n**Key Points:**\n1. Clear phase separation (uncached vs cached)\n2. Proper warmup before measurements\n3. Statistical analysis of results\n4. Comparison and speedup calculation\n5. Target assertions\n6. Results storage\n\n#### Pattern 2: Scalability Testing\n\n**Purpose:** Measure performance at different scales\n\n```bash\n#!/bin/bash\n# Benchmark: Cache Performance at Scale\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nREPO_DIR=\"$SCRIPT_DIR/..\"\n\nsource \"$SCRIPT_DIR/bench-helpers.sh\"\nsource \"$REPO_DIR/lib/cache-index.sh\"\n\nmain() {\n bench_header \"Cache Performance at Scale\"\n\n echo \"Testing cache performance with different folder counts\"\n echo \"\"\n\n benchmark_scale_10\n echo \"\"\n benchmark_scale_50\n echo \"\"\n benchmark_scale_500\n echo \"\"\n benchmark_scale_1000\n\n generate_summary\n}\n\nbenchmark_scale() {\n local count=\"$1\"\n local target=\"${2:-100}\"\n\n bench_section \"Benchmark: $count Folders\"\n\n # Setup workspace\n local workspace=$(bench_create_workspace_with_count \"$count\")\n local old_paths=\"$GOTO_SEARCH_PATHS\"\n export GOTO_SEARCH_PATHS=\"$workspace\"\n\n # Build cache\n __goto_cache_build\n\n # Warmup\n bench_warmup \"__goto_cache_lookup folder-$((count / 2))\" 3\n\n # Run benchmark\n local stats=$(bench_run \"scale_$count\" \\\n \"__goto_cache_lookup folder-$((count / 2))\" 10)\n\n IFS=',' read -r min max mean median stddev \u003c\u003c\u003c \"$stats\"\n\n bench_print_stats \"$stats\" \"Results ($count folders)\"\n\n # Assert target\n bench_assert_target \"$mean\" \"$target\" \"Cache lookup at scale\"\n\n # Save results\n bench_save_result \"cache_scale\" \"$stats\" \"folders_$count\"\n\n # Cleanup\n export GOTO_SEARCH_PATHS=\"$old_paths\"\n bench_cleanup_workspace \"$workspace\"\n}\n\nbench_create_workspace_with_count() {\n local count=\"$1\"\n local workspace=$(mktemp -d)\n\n for i in $(seq 1 $count); do\n mkdir -p \"$workspace/folder-$i\"\n done\n\n echo \"$workspace\"\n}\n\nbenchmark_scale_10() { benchmark_scale 10 50; }\nbenchmark_scale_50() { benchmark_scale 50 75; }\nbenchmark_scale_500() { benchmark_scale 500 100; }\nbenchmark_scale_1000() { benchmark_scale 1000 150; }\n\nmain\nexit 0\n```\n\n**Key Points:**\n1. Test at multiple scale points\n2. Adjust targets based on scale\n3. Workspace generation for each scale\n4. Proper cleanup between tests\n5. Results tracking per scale level\n\n#### Pattern 3: Multi-Level Path Performance\n\n**Purpose:** Measure performance with complex navigation paths\n\n```bash\n#!/bin/bash\n# Benchmark: Multi-Level Path Navigation\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nREPO_DIR=\"$SCRIPT_DIR/..\"\n\nsource \"$SCRIPT_DIR/bench-helpers.sh\"\nsource \"$REPO_DIR/lib/goto-function.sh\"\n\nmain() {\n bench_header \"Multi-Level Path Navigation Performance\"\n\n echo \"Testing navigation with multi-level paths (e.g., LUXOR/unix-goto)\"\n echo \"\"\n\n benchmark_multi_level_paths\n\n generate_summary\n}\n\nbenchmark_multi_level_paths() {\n bench_section \"Benchmark: Multi-Level Path Navigation\"\n\n # Setup nested workspace\n local workspace=$(bench_create_nested_workspace 4 3)\n local old_paths=\"$GOTO_SEARCH_PATHS\"\n export GOTO_SEARCH_PATHS=\"$workspace\"\n\n # Build cache\n __goto_cache_build\n\n # Test single-level path\n echo \"Single-level path lookup:\"\n bench_warmup \"goto level0-1\" 3\n local single_stats=$(bench_run \"single_level\" \"goto level0-1\" 10)\n bench_print_stats \"$single_stats\" \"Single-Level Results\"\n\n echo \"\"\n\n # Test two-level path\n echo \"Two-level path lookup:\"\n bench_warmup \"goto level0-1/level1-1\" 3\n local double_stats=$(bench_run \"double_level\" \"goto level0-1/level1-1\" 10)\n bench_print_stats \"$double_stats\" \"Two-Level Results\"\n\n echo \"\"\n\n # Test three-level path\n echo \"Three-level path lookup:\"\n bench_warmup \"goto level0-1/level1-1/level2-1\" 3\n local triple_stats=$(bench_run \"triple_level\" \"goto level0-1/level1-1/level2-1\" 10)\n bench_print_stats \"$triple_stats\" \"Three-Level Results\"\n\n # Analysis\n echo \"\"\n echo \"Path Complexity Analysis:\"\n IFS=',' read -r s_min s_max s_mean s_median s_stddev \u003c\u003c\u003c \"$single_stats\"\n IFS=',' read -r d_min d_max d_mean d_median d_stddev \u003c\u003c\u003c \"$double_stats\"\n IFS=',' read -r t_min t_max t_mean t_median t_stddev \u003c\u003c\u003c \"$triple_stats\"\n\n printf \" Single-level mean: %dms\\n\" \"$s_mean\"\n printf \" Two-level mean: %dms\\n\" \"$d_mean\"\n printf \" Three-level mean: %dms\\n\" \"$t_mean\"\n\n # All should be \u003c100ms\n bench_assert_target \"$s_mean\" 100 \"Single-level navigation\"\n bench_assert_target \"$d_mean\" 100 \"Two-level navigation\"\n bench_assert_target \"$t_mean\" 100 \"Three-level navigation\"\n\n # Save results\n bench_save_result \"multi_level_paths\" \"$single_stats\" \"single_level\"\n bench_save_result \"multi_level_paths\" \"$double_stats\" \"double_level\"\n bench_save_result \"multi_level_paths\" \"$triple_stats\" \"triple_level\"\n\n # Cleanup\n export GOTO_SEARCH_PATHS=\"$old_paths\"\n bench_cleanup_workspace \"$workspace\"\n}\n\nmain\nexit 0\n```\n\n**Key Points:**\n1. Test increasing complexity\n2. Nested workspace generation\n3. Measure each level independently\n4. Compare complexity impact\n5. Ensure all levels meet targets\n\n## Examples\n\n### Example 1: Complete Cache Build Benchmark\n\n```bash\n#!/bin/bash\n# Benchmark: Cache Build Performance\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nREPO_DIR=\"$SCRIPT_DIR/..\"\n\nsource \"$SCRIPT_DIR/bench-helpers.sh\"\nsource \"$REPO_DIR/lib/cache-index.sh\"\n\nmain() {\n bench_header \"Cache Build Performance\"\n\n echo \"Configuration:\"\n echo \" Search paths: $GOTO_SEARCH_PATHS\"\n echo \" Max depth: ${GOTO_SEARCH_DEPTH:-3}\"\n echo \" Iterations: 10\"\n echo \"\"\n\n benchmark_cache_build\n\n generate_summary\n}\n\nbenchmark_cache_build() {\n bench_section \"Benchmark: Cache Build Time\"\n\n # Count folders to be indexed\n echo \"Analyzing workspace...\"\n local folder_count=$(find ${GOTO_SEARCH_PATHS//:/ } -type d -maxdepth ${GOTO_SEARCH_DEPTH:-3} 2>/dev/null | wc -l)\n echo \" Folders to index: $folder_count\"\n echo \"\"\n\n # Phase 1: Full cache build\n echo \"Phase 1: Full cache build (cold start)\"\n echo \"─────────────────────────────────────────\"\n\n # Remove existing cache\n rm -f \"$HOME/.goto_index\"\n\n # Warmup filesystem cache\n find ${GOTO_SEARCH_PATHS//:/ } -type d -maxdepth ${GOTO_SEARCH_DEPTH:-3} > /dev/null 2>&1\n\n # Run benchmark\n local build_times=()\n for i in {1..10}; do\n rm -f \"$HOME/.goto_index\"\n local time=$(bench_time_ms \"__goto_cache_build\")\n build_times+=(\"$time\")\n printf \" Build %2d: %dms\\n\" \"$i\" \"$time\"\n done\n\n local build_stats=$(bench_calculate_stats \"${build_times[@]}\")\n IFS=',' read -r min max mean median stddev \u003c\u003c\u003c \"$build_stats\"\n\n bench_print_stats \"$build_stats\" \"Build Performance\"\n\n # Analysis\n echo \"\"\n echo \"Performance Analysis:\"\n printf \" Folders indexed: %d\\n\" \"$folder_count\"\n printf \" Average build time: %dms\\n\" \"$mean\"\n printf \" Time per folder: %.2fms\\n\" \\\n $(echo \"scale=2; $mean / $folder_count\" | bc)\n\n # Assert target (\u003c5000ms = 5 seconds)\n bench_assert_target \"$mean\" 5000 \"Cache build time\"\n\n # Save results\n bench_save_result \"cache_build\" \"$build_stats\" \"full_build,folders=$folder_count\"\n}\n\nmain\nexit 0\n```\n\n### Example 2: Parallel Navigation Benchmark\n\n```bash\n#!/bin/bash\n# Benchmark: Parallel Navigation Performance\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nREPO_DIR=\"$SCRIPT_DIR/..\"\n\nsource \"$SCRIPT_DIR/bench-helpers.sh\"\nsource \"$REPO_DIR/lib/cache-index.sh\"\n\nmain() {\n bench_header \"Parallel Navigation Performance\"\n\n echo \"Testing concurrent cache access performance\"\n echo \"\"\n\n benchmark_parallel_navigation\n\n generate_summary\n}\n\nbenchmark_parallel_navigation() {\n bench_section \"Benchmark: Concurrent Cache Access\"\n\n # Setup\n __goto_cache_build\n\n # Test different concurrency levels\n for concurrency in 1 5 10 20; do\n echo \"\"\n echo \"Testing with $concurrency concurrent lookups:\"\n echo \"─────────────────────────────────────────\"\n\n local times=()\n\n for run in {1..10}; do\n local start=$(date +%s%N)\n\n # Launch concurrent lookups\n for i in $(seq 1 $concurrency); do\n __goto_cache_lookup \"unix-goto\" > /dev/null 2>&1 &\n done\n\n # Wait for all to complete\n wait\n\n local end=$(date +%s%N)\n local duration=$(((end - start) / 1000000))\n times+=(\"$duration\")\n printf \" Run %2d: %dms\\n\" \"$run\" \"$duration\"\n done\n\n local stats=$(bench_calculate_stats \"${times[@]}\")\n IFS=',' read -r min max mean median stddev \u003c\u003c\u003c \"$stats\"\n\n echo \"\"\n echo \"Results (concurrency=$concurrency):\"\n printf \" Mean time: %dms\\n\" \"$mean\"\n printf \" Time per lookup: %dms\\n\" \\\n $((mean / concurrency))\n\n # Save results\n bench_save_result \"parallel_navigation\" \"$stats\" \"concurrency=$concurrency\"\n done\n\n echo \"\"\n echo \"Analysis:\"\n echo \" Cache supports concurrent reads efficiently\"\n echo \" No significant degradation with increased concurrency\"\n}\n\nmain\nexit 0\n```\n\n## Best Practices\n\n### Benchmark Design Principles\n\n**1. Statistical Validity**\n- Run at least 10 iterations\n- Use proper warmup (3+ runs)\n- Calculate full statistics (min/max/mean/median/stddev)\n- Report median for central tendency (less affected by outliers)\n- Report stddev to show consistency\n\n**2. Realistic Testing**\n- Test at production-like scale\n- Use realistic workspaces\n- Test common user workflows\n- Include edge cases\n\n**3. Isolation**\n- Run on idle system\n- Disable unnecessary background processes\n- Clear caches between test phases\n- Use dedicated test workspaces\n\n**4. Reproducibility**\n- Document all configuration\n- Use consistent test data\n- Version benchmark code\n- Save all results\n\n**5. Clarity**\n- Clear benchmark names\n- Descriptive output\n- Meaningful comparisons\n- Actionable insights\n\n### Performance Target Setting\n\n**Define targets based on user perception:**\n\n| Range | User Perception | Use Case |\n|-------|----------------|----------|\n| \u003c50ms | Instant | Critical path operations |\n| \u003c100ms | Very fast | Interactive operations |\n| \u003c200ms | Fast | Background operations |\n| \u003c1s | Acceptable | Initial setup |\n| >1s | Slow | Needs optimization |\n\n**unix-goto targets:**\n- Navigation: \u003c100ms (feels instant)\n- Lookups: \u003c10ms (imperceptible)\n- Cache build: \u003c5s (acceptable for setup)\n\n### Results Analysis\n\n**Key metrics to track:**\n\n1. **Mean** - Average performance (primary metric)\n2. **Median** - Middle value (better for skewed distributions)\n3. **Min** - Best case performance\n4. **Max** - Worst case performance\n5. **Stddev** - Consistency (lower is better)\n\n**Red flags:**\n- High stddev (>20% of mean) - inconsistent performance\n- Increasing trend over time - performance regression\n- Max >> Mean - outliers, possible issues\n\n### CSV Results Format\n\n**Standard format:**\n```csv\ntimestamp,benchmark_name,operation,min_ms,max_ms,mean_ms,median_ms,stddev,metadata\n1704123456,cached_vs_uncached,uncached,25,32,28,28,2.1,\n1704123456,cached_vs_uncached,cached,15,22,18,19,1.8,\n1704123457,cache_scale,folders_10,10,15,12,12,1.5,\n1704123458,cache_scale,folders_500,85,110,95,92,8.2,\n```\n\n**Benefits:**\n- Easy to parse and analyze\n- Compatible with Excel/Google Sheets\n- Can track trends over time\n- Enables automated regression detection\n\n## Quick Reference\n\n### Essential Benchmark Functions\n\n```bash\n# Timing\nbench_time_ms \"command args\" # High-precision timing\nbench_warmup \"command\" 3 # Warmup iterations\nbench_run \"name\" \"command\" 10 # Full benchmark run\n\n# Statistics\nbench_calculate_stats val1 val2 val3 # Calculate stats\nbench_compare baseline optimized # Calculate speedup\n\n# Workspace\nbench_create_workspace \"medium\" # Create test workspace\nbench_create_nested_workspace 3 5 # Nested workspace\nbench_cleanup_workspace \"$workspace\" # Remove workspace\n\n# Output\nbench_header \"Title\" # Print header\nbench_section \"Section\" # Print section\nbench_print_stats \"$stats\" \"Label\" # Print statistics\nbench_print_comparison \"$s1\" \"$s2\" # Print comparison\n\n# Assertions\nbench_assert_target actual target \"msg\" # Assert performance target\nbench_assert_improvement base opt min \"m\" # Assert improvement\n\n# Results\nbench_save_result \"name\" \"$stats\" \"op\" # Save to CSV\nbench_load_results \"name\" # Load historical results\n```\n\n### Standard Benchmark Workflow\n\n```bash\n# 1. Setup\nbench_header \"Benchmark Title\"\nworkspace=$(bench_create_workspace \"medium\")\n\n# 2. Warmup\nbench_warmup \"command\" 3\n\n# 3. Measure\nstats=$(bench_run \"name\" \"command\" 10)\n\n# 4. Analyze\nIFS=',' read -r min max mean median stddev \u003c\u003c\u003c \"$stats\"\nbench_print_stats \"$stats\" \"Results\"\n\n# 5. Assert\nbench_assert_target \"$mean\" 100 \"Performance\"\n\n# 6. Save\nbench_save_result \"benchmark\" \"$stats\" \"operation\"\n\n# 7. Cleanup\nbench_cleanup_workspace \"$workspace\"\n```\n\n### Performance Targets Quick Reference\n\n| Operation | Target | Rationale |\n|-----------|--------|-----------|\n| Cached navigation | \u003c100ms | Instant feel |\n| Bookmark lookup | \u003c10ms | Imperceptible |\n| Cache build | \u003c5s | Setup time |\n| Cache speedup | >20x | Significant improvement |\n| Cache hit rate | >90% | Most queries cached |\n\n---\n\n**Skill Version:** 1.0\n**Last Updated:** October 2025\n**Maintained By:** Manu Tej + Claude Code\n**Source:** unix-goto benchmark patterns and methodologies\n---","attachment_filenames":["README.md"],"attachments":[{"filename":"README.md","content":"# Performance Benchmark Specialist Skill\n\nAdvanced performance benchmarking expertise for shell tools with statistical analysis and comprehensive reporting.\n\n## Overview\n\nThis skill provides rigorous performance benchmarking expertise, including:\n\n- **Benchmark Design**: Standard structure and patterns\n- **Statistical Analysis**: min/max/mean/median/standard deviation\n- **Performance Targets**: \u003c100ms navigation, >90% cache hit rate, >20x speedup\n- **Workspace Generation**: Test environments at multiple scales\n- **Results Storage**: CSV format with historical tracking\n- **Comprehensive Reporting**: Professional benchmark output\n- **Helper Library**: Complete benchmarking utilities\n\n## When to Use\n\nUse this skill when:\n- Creating performance benchmarks for shell scripts\n- Measuring and validating performance targets\n- Implementing statistical analysis for results\n- Designing benchmark workspaces and test environments\n- Comparing baseline vs optimized performance\n- Generating performance reports\n- Storing benchmark results for trend analysis\n- Validating performance regressions\n\n## Key Features\n\n### Performance-First Development\n\nPerformance is a core requirement, not an afterthought:\n1. Define targets BEFORE implementation\n2. Measure EVERYTHING that matters\n3. Use statistical analysis, not single runs\n4. Test at realistic scale\n5. Validate against targets automatically\n\n### Performance Targets (unix-goto)\n\n| Metric | Target | Rationale |\n|--------|--------|-----------|\n| Cached navigation | \u003c100ms | Sub-100ms feels instant |\n| Bookmark lookup | \u003c10ms | Near-instant access |\n| Cache speedup | >20x | Significant improvement |\n| Cache hit rate | >90% | Most queries cached |\n| Cache build | \u003c5s | Fast initial setup |\n\n### Statistical Analysis\n\nEvery benchmark calculates:\n- **Min**: Best case performance\n- **Max**: Worst case performance\n- **Mean**: Average performance (primary metric)\n- **Median**: Middle value (better for skewed distributions)\n- **Standard Deviation**: Consistency measure\n\n### Benchmark Helper Library\n\nComplete set of utilities:\n- `bench_time_ms`: High-precision timing\n- `bench_calculate_stats`: Statistical analysis\n- `bench_run`: Complete benchmark execution\n- `bench_warmup`: Reduce measurement noise\n- `bench_create_workspace`: Generate test environments\n- `bench_print_stats`: Professional output formatting\n- `bench_assert_target`: Automatic target validation\n- `bench_save_result`: CSV storage\n- `bench_compare`: Speedup calculation\n\n## Installation\n\nThis skill is already installed at:\n```\n~/Library/Application Support/Claude/skills/performance-benchmark-specialist/\n```\n\n## Usage\n\nSimply mention performance benchmarking tasks in your conversation with Claude:\n\n```\n\"Create a benchmark to measure cached vs uncached navigation performance\"\n\"Help me benchmark cache performance at different scales (10, 50, 500 folders)\"\n\"Generate a comprehensive benchmark suite with statistical analysis\"\n```\n\nClaude will automatically activate this skill and guide you through creating rigorous benchmarks.\n\n## Examples\n\n### Example 1: Cached vs Uncached Comparison\n```\n\"Create a benchmark comparing cached vs uncached navigation performance.\nInclude statistical analysis and speedup calculation.\"\n```\n\nClaude will generate:\n- Phase 1: Uncached baseline measurement\n- Phase 2: Cached optimized measurement\n- Statistical analysis for both phases\n- Speedup ratio calculation\n- Performance target assertions\n- CSV results storage\n- Professional report generation\n\n### Example 2: Scalability Testing\n```\n\"Benchmark cache performance at 10, 50, 500, and 1000 folders.\nVerify all scale points meet the \u003c100ms target.\"\n```\n\nClaude will:\n- Create workspaces at each scale\n- Run benchmarks with proper warmup\n- Calculate statistics for each scale\n- Adjust targets based on scale\n- Generate comparative analysis\n- Store results for trend tracking\n\n### Example 3: Complete Benchmark Suite\n```\n\"Create a comprehensive benchmark suite covering:\n- Cached vs uncached performance\n- Multi-level path navigation\n- Cache build performance\n- Parallel concurrent access\nStore all results in CSV format.\"\n```\n\n## Skill Contents\n\n- **SKILL.md** (1,192 lines): Complete benchmarking expertise\n - Standard benchmark structure\n - Helper library (complete implementation)\n - Benchmark patterns (3 detailed patterns)\n - Statistical analysis methods\n - Workspace generation utilities\n - Results storage and analysis\n - Professional reporting\n - Best practices\n\n## Example Benchmark Structure\n\n```bash\n#!/bin/bash\n# Benchmark: Feature Performance\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nsource \"$SCRIPT_DIR/bench-helpers.sh\"\n\nmain() {\n bench_header \"Benchmark Title\"\n\n # Setup workspace\n local workspace=$(bench_create_workspace \"medium\")\n\n # Warmup\n bench_warmup \"command\" 3\n\n # Run benchmark\n local stats=$(bench_run \"name\" \"command\" 10)\n\n # Analyze\n IFS=',' read -r min max mean median stddev \u003c\u003c\u003c \"$stats\"\n bench_print_stats \"$stats\" \"Results\"\n\n # Assert target\n bench_assert_target \"$mean\" 100 \"Performance\"\n\n # Save\n bench_save_result \"benchmark\" \"$stats\" \"operation\"\n\n # Cleanup\n bench_cleanup_workspace \"$workspace\"\n}\n\nmain\nexit 0\n```\n\n## Benchmark Output Format\n\n```\n╔══════════════════════════════════════════════════════════════════╗\n║ Cached vs Uncached Navigation Performance ║\n╚══════════════════════════════════════════════════════════════════╝\n\nPhase 1: Uncached lookup (no cache)\n─────────────────────────────────\n Run 1: 215ms\n Run 2: 208ms\n ...\n\nResults:\n Min: 203ms\n Max: 229ms\n Mean: 215ms\n Median: 214ms\n Std Dev: 7.12ms\n\nPhase 2: Cached lookup (with cache)\n─────────────────────────────────\n Run 1: 26ms\n Run 2: 24ms\n ...\n\nResults:\n Min: 23ms\n Max: 30ms\n Mean: 26ms\n Median: 26ms\n Std Dev: 2.01ms\n\nPerformance Analysis:\n Speedup ratio: 8.27x\n\n✓ Cached navigation time meets target: 26ms (target: \u003c100ms)\n```\n\n## CSV Results Format\n\n```csv\ntimestamp,benchmark_name,operation,min_ms,max_ms,mean_ms,median_ms,stddev,metadata\n1704123456,cached_vs_uncached,uncached,203,229,215,214,7.12,\n1704123456,cached_vs_uncached,cached,23,30,26,26,2.01,\n```\n\n## Version\n\n- **Version**: 1.0\n- **Created**: October 2025\n- **Source**: unix-goto benchmark patterns\n- **Lines**: 1,192\n\n## Related Skills\n\n- **unix-goto-development**: Complete development workflow\n- **shell-testing-framework**: Comprehensive testing patterns\n\n## License\n\nThis skill is created for performance benchmarking based on unix-goto patterns by Manu Tej + Claude Code.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":7447,"content_sha256":"5bd8beeba6cd4b1acc474de1070ef815e8a4dd68fe106a45ff8a279bc36f9a45"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Performance Benchmark Specialist","type":"text"}]},{"type":"paragraph","content":[{"text":"Comprehensive performance benchmarking expertise for shell-based tools, focusing on rigorous measurement, statistical analysis, and actionable performance optimization using patterns from the unix-goto project.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"When to Use This Skill","type":"text"}]},{"type":"paragraph","content":[{"text":"Use this skill when:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Creating performance benchmarks for shell scripts","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Measuring and validating performance targets","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Implementing statistical analysis for benchmark results","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Designing benchmark workspaces and test environments","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Generating performance reports with min/max/mean/median/stddev","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Comparing baseline vs optimized performance","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Storing benchmark results in CSV format","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Validating performance regressions","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Optimizing shell script performance","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Do NOT use this skill for:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Application profiling (use language-specific profilers)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Production performance monitoring (use APM tools)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Load testing web services (use JMeter, k6, etc.)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Simple timing measurements (use basic ","type":"text"},{"text":"time","type":"text","marks":[{"type":"code_inline"}]},{"text":" command)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Core Performance Philosophy","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Performance-First Development","type":"text"}]},{"type":"paragraph","content":[{"text":"Performance is NOT an afterthought - it's a core requirement from day one.","type":"text"}]},{"type":"paragraph","content":[{"text":"unix-goto Performance Principles:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Define targets BEFORE implementation","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Measure EVERYTHING that matters","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use statistical analysis, not single runs","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Test at realistic scale","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Validate against targets automatically","type":"text","marks":[{"type":"strong"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Performance Targets from unix-goto","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Metric","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Target","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Rationale","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cached navigation","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003c100ms","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Sub-100ms feels instant to users","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Bookmark lookup","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003c10ms","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Near-instant access required","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cache speedup","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":">20x","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Significant improvement over uncached","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cache hit rate","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":">90%","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Most lookups should hit cache","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cache build","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003c5s","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fast initial setup, minimal wait","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"Achieved Results:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cached navigation: 26ms (74ms under target)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cache build: 3-5s (meets target)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cache hit rate: 92-95% (exceeds target)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Speedup ratio: 8x (work in progress to reach 20x)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Core Knowledge","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Standard Benchmark Structure","type":"text"}]},{"type":"paragraph","content":[{"text":"Every benchmark follows this exact structure:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"#!/bin/bash\n# Benchmark: [Description]\n\n# ============================================\n# Setup\n# ============================================\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nREPO_DIR=\"$SCRIPT_DIR/..\"\n\nsource \"$SCRIPT_DIR/bench-helpers.sh\"\nsource \"$REPO_DIR/lib/module.sh\"\n\n# ============================================\n# Main Function\n# ============================================\n\nmain() {\n bench_header \"Benchmark Title\"\n\n echo \"Configuration:\"\n echo \" Iterations: 10\"\n echo \" Warmup: 3 runs\"\n echo \" Workspace: medium (50 folders)\"\n echo \"\"\n\n benchmark_feature\n\n generate_summary\n}\n\n# ============================================\n# Benchmark Function\n# ============================================\n\nbenchmark_feature() {\n bench_section \"Benchmark Section\"\n\n # Setup\n local workspace=$(bench_create_workspace \"medium\")\n\n # Phase 1: Baseline\n echo \"Phase 1: Baseline measurement\"\n echo \"─────────────────────────────────\"\n\n # Warmup\n bench_warmup \"command\" 3\n\n # Run benchmark\n local baseline_stats=$(bench_run \"baseline\" \"command\" 10)\n\n # Extract statistics\n IFS=',' read -r min max mean median stddev \u003c\u003c\u003c \"$baseline_stats\"\n\n # Print results\n bench_print_stats \"$baseline_stats\" \"Baseline Results\"\n\n # Phase 2: Optimized\n echo \"\"\n echo \"Phase 2: Optimized measurement\"\n echo \"─────────────────────────────────\"\n\n # Implementation of optimization\n optimize_feature\n\n # Warmup\n bench_warmup \"optimized_command\" 3\n\n # Run benchmark\n local optimized_stats=$(bench_run \"optimized\" \"optimized_command\" 10)\n\n # Extract statistics\n IFS=',' read -r opt_min opt_max opt_mean opt_median opt_stddev \u003c\u003c\u003c \"$optimized_stats\"\n\n # Print results\n bench_print_stats \"$optimized_stats\" \"Optimized Results\"\n\n # Compare and analyze\n local speedup=$(bench_compare \"$mean\" \"$opt_mean\")\n echo \"\"\n echo \"Performance Analysis:\"\n echo \" Speedup ratio: ${speedup}x\"\n\n # Assert targets\n bench_assert_target \"$opt_mean\" 100 \"Optimized performance\"\n\n # Save results\n bench_save_result \"benchmark_name\" \"$baseline_stats\" \"baseline\"\n bench_save_result \"benchmark_name\" \"$optimized_stats\" \"optimized\"\n\n # Cleanup\n bench_cleanup_workspace \"$workspace\"\n}\n\n# ============================================\n# Execute\n# ============================================\n\nmain\nexit 0","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Benchmark Helper Library","type":"text"}]},{"type":"paragraph","content":[{"text":"The complete helper library provides ALL benchmarking utilities:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"#!/bin/bash\n# bench-helpers.sh - Comprehensive benchmark utilities\n\n# ============================================\n# Configuration\n# ============================================\n\nBENCH_RESULTS_DIR=\"${BENCH_RESULTS_DIR:-$HOME/.goto_benchmarks}\"\nBENCH_WARMUP_ITERATIONS=\"${BENCH_WARMUP_ITERATIONS:-3}\"\nBENCH_DEFAULT_ITERATIONS=\"${BENCH_DEFAULT_ITERATIONS:-10}\"\n\n# ============================================\n# Timing Functions\n# ============================================\n\n# High-precision timing in milliseconds\nbench_time_ms() {\n local cmd=\"$*\"\n local start=$(date +%s%N)\n eval \"$cmd\" > /dev/null 2>&1\n local end=$(date +%s%N)\n echo $(((end - start) / 1000000))\n}\n\n# Warmup iterations to reduce noise\nbench_warmup() {\n local cmd=\"$1\"\n local iterations=\"${2:-$BENCH_WARMUP_ITERATIONS}\"\n\n for i in $(seq 1 $iterations); do\n eval \"$cmd\" > /dev/null 2>&1\n done\n}\n\n# Run benchmark with N iterations\nbench_run() {\n local name=\"$1\"\n local cmd=\"$2\"\n local iterations=\"${3:-$BENCH_DEFAULT_ITERATIONS}\"\n\n local times=()\n\n for i in $(seq 1 $iterations); do\n local time=$(bench_time_ms \"$cmd\")\n times+=(\"$time\")\n printf \" Run %2d: %dms\\n\" \"$i\" \"$time\"\n done\n\n bench_calculate_stats \"${times[@]}\"\n}\n\n# ============================================\n# Statistical Analysis\n# ============================================\n\n# Calculate comprehensive statistics\nbench_calculate_stats() {\n local values=(\"$@\")\n local count=${#values[@]}\n\n if [ $count -eq 0 ]; then\n echo \"0,0,0,0,0\"\n return 1\n fi\n\n # Sort values for percentile calculations\n IFS=

Performance Benchmark Specialist Comprehensive performance benchmarking expertise for shell-based tools, focusing on rigorous measurement, statistical analysis, and actionable performance optimization using patterns from the unix-goto project. When to Use This Skill Use this skill when: - Creating performance benchmarks for shell scripts - Measuring and validating performance targets - Implementing statistical analysis for benchmark results - Designing benchmark workspaces and test environments - Generating performance reports with min/max/mean/median/stddev - Comparing baseline vs optimized…

\\n' sorted=($(sort -n \u003c\u003c\u003c\"${values[*]}\"))\n unset IFS\n\n # Min and Max\n local min=${sorted[0]}\n local max=${sorted[$((count-1))]}\n\n # Mean (average)\n local sum=0\n for val in \"${values[@]}\"; do\n sum=$((sum + val))\n done\n local mean=$((sum / count))\n\n # Median (50th percentile)\n local mid=$((count / 2))\n if [ $((count % 2)) -eq 0 ]; then\n # Even number of values - average the two middle values\n local median=$(( (${sorted[$mid-1]} + ${sorted[$mid]}) / 2 ))\n else\n # Odd number of values - take the middle value\n local median=${sorted[$mid]}\n fi\n\n # Standard deviation\n local variance=0\n for val in \"${values[@]}\"; do\n local diff=$((val - mean))\n variance=$((variance + diff * diff))\n done\n variance=$((variance / count))\n\n # Use bc for square root if available, otherwise approximate\n if command -v bc &> /dev/null; then\n local stddev=$(echo \"scale=2; sqrt($variance)\" | bc)\n else\n # Simple approximation without bc\n local stddev=$(awk \"BEGIN {printf \\\"%.2f\\\", sqrt($variance)}\")\n fi\n\n # Return CSV format: min,max,mean,median,stddev\n echo \"$min,$max,$mean,$median,$stddev\"\n}\n\n# Compare two measurements and calculate speedup\nbench_compare() {\n local baseline=\"$1\"\n local optimized=\"$2\"\n\n if [ \"$optimized\" -eq 0 ]; then\n echo \"inf\"\n return\n fi\n\n if command -v bc &> /dev/null; then\n local speedup=$(echo \"scale=2; $baseline / $optimized\" | bc)\n else\n local speedup=$(awk \"BEGIN {printf \\\"%.2f\\\", $baseline / $optimized}\")\n fi\n\n echo \"$speedup\"\n}\n\n# Calculate percentile\nbench_percentile() {\n local percentile=\"$1\"\n shift\n local values=(\"$@\")\n local count=${#values[@]}\n\n IFS=

Performance Benchmark Specialist Comprehensive performance benchmarking expertise for shell-based tools, focusing on rigorous measurement, statistical analysis, and actionable performance optimization using patterns from the unix-goto project. When to Use This Skill Use this skill when: - Creating performance benchmarks for shell scripts - Measuring and validating performance targets - Implementing statistical analysis for benchmark results - Designing benchmark workspaces and test environments - Generating performance reports with min/max/mean/median/stddev - Comparing baseline vs optimized…

\\n' sorted=($(sort -n \u003c\u003c\u003c\"${values[*]}\"))\n unset IFS\n\n local index=$(echo \"scale=0; ($count * $percentile) / 100\" | bc)\n echo \"${sorted[$index]}\"\n}\n\n# ============================================\n# Output Formatting\n# ============================================\n\n# Print formatted header\nbench_header() {\n local title=\"$1\"\n echo \"╔══════════════════════════════════════════════════════════════════╗\"\n printf \"║ %-62s ║\\n\" \"$title\"\n echo \"╚══════════════════════════════════════════════════════════════════╝\"\n echo \"\"\n}\n\n# Print section divider\nbench_section() {\n local title=\"$1\"\n echo \"$title\"\n echo \"─────────────────────────────────────────────────────────────────\"\n}\n\n# Print individual result\nbench_result() {\n local label=\"$1\"\n local value=\"$2\"\n printf \" %-50s %10s\\n\" \"$label:\" \"$value\"\n}\n\n# Print statistics block\nbench_print_stats() {\n local stats=\"$1\"\n local label=\"${2:-Results}\"\n\n IFS=',' read -r min max mean median stddev \u003c\u003c\u003c \"$stats\"\n\n echo \"\"\n echo \"$label:\"\n printf \" Min: %dms\\n\" \"$min\"\n printf \" Max: %dms\\n\" \"$max\"\n printf \" Mean: %dms\\n\" \"$mean\"\n printf \" Median: %dms\\n\" \"$median\"\n printf \" Std Dev: %.2fms\\n\" \"$stddev\"\n}\n\n# Print comparison results\nbench_print_comparison() {\n local baseline_stats=\"$1\"\n local optimized_stats=\"$2\"\n\n IFS=',' read -r b_min b_max b_mean b_median b_stddev \u003c\u003c\u003c \"$baseline_stats\"\n IFS=',' read -r o_min o_max o_mean o_median o_stddev \u003c\u003c\u003c \"$optimized_stats\"\n\n local speedup=$(bench_compare \"$b_mean\" \"$o_mean\")\n local improvement=$(echo \"scale=2; 100 - ($o_mean * 100 / $b_mean)\" | bc)\n\n echo \"\"\n echo \"Performance Comparison:\"\n echo \"─────────────────────────────────\"\n printf \" Baseline mean: %dms\\n\" \"$b_mean\"\n printf \" Optimized mean: %dms\\n\" \"$o_mean\"\n printf \" Speedup: %.2fx\\n\" \"$speedup\"\n printf \" Improvement: %.1f%%\\n\" \"$improvement\"\n}\n\n# ============================================\n# Assertions and Validation\n# ============================================\n\n# Assert performance target is met\nbench_assert_target() {\n local actual=\"$1\"\n local target=\"$2\"\n local label=\"$3\"\n\n if [ \"$actual\" -lt \"$target\" ]; then\n echo \"✓ $label meets target: ${actual}ms (target: \u003c${target}ms)\"\n return 0\n else\n echo \"✗ $label exceeds target: ${actual}ms (target: \u003c${target}ms)\"\n return 1\n fi\n}\n\n# Assert improvement over baseline\nbench_assert_improvement() {\n local baseline=\"$1\"\n local optimized=\"$2\"\n local min_speedup=\"$3\"\n local label=\"${4:-Performance}\"\n\n local speedup=$(bench_compare \"$baseline\" \"$optimized\")\n\n if (( $(echo \"$speedup >= $min_speedup\" | bc -l) )); then\n echo \"✓ $label improved: ${speedup}x (required: >${min_speedup}x)\"\n return 0\n else\n echo \"✗ $label insufficient: ${speedup}x (required: >${min_speedup}x)\"\n return 1\n fi\n}\n\n# ============================================\n# Results Storage\n# ============================================\n\n# Initialize results directory\nbench_init() {\n mkdir -p \"$BENCH_RESULTS_DIR\"\n}\n\n# Save benchmark result to CSV\nbench_save_result() {\n bench_init\n\n local name=\"$1\"\n local stats=\"$2\"\n local operation=\"${3:-}\"\n\n local timestamp=$(date +%s)\n local results_file=\"$BENCH_RESULTS_DIR/results.csv\"\n\n # Create header if file doesn't exist\n if [ ! -f \"$results_file\" ]; then\n echo \"timestamp,benchmark_name,operation,min_ms,max_ms,mean_ms,median_ms,stddev,metadata\" > \"$results_file\"\n fi\n\n # Append result\n echo \"$timestamp,$name,$operation,$stats,\" >> \"$results_file\"\n}\n\n# Load historical results\nbench_load_results() {\n local name=\"$1\"\n local operation=\"${2:-}\"\n\n local results_file=\"$BENCH_RESULTS_DIR/results.csv\"\n\n if [ ! -f \"$results_file\" ]; then\n return 1\n fi\n\n if [ -n \"$operation\" ]; then\n grep \"^[^,]*,$name,$operation,\" \"$results_file\"\n else\n grep \"^[^,]*,$name,\" \"$results_file\"\n fi\n}\n\n# Generate summary report\ngenerate_summary() {\n echo \"\"\n echo \"╔══════════════════════════════════════════════════════════════════╗\"\n echo \"║ Benchmark Complete ║\"\n echo \"╚══════════════════════════════════════════════════════════════════╝\"\n echo \"\"\n echo \"Results saved to: $BENCH_RESULTS_DIR/results.csv\"\n echo \"\"\n}\n\n# ============================================\n# Workspace Management\n# ============================================\n\n# Create test workspace\nbench_create_workspace() {\n local size=\"${1:-medium}\"\n local workspace=$(mktemp -d)\n\n case \"$size\" in\n tiny)\n # 5 folders\n for i in {1..5}; do\n mkdir -p \"$workspace/folder-$i\"\n done\n ;;\n small)\n # 10 folders\n for i in {1..10}; do\n mkdir -p \"$workspace/folder-$i\"\n done\n ;;\n medium)\n # 50 folders\n for i in {1..50}; do\n mkdir -p \"$workspace/folder-$i\"\n done\n ;;\n large)\n # 500 folders\n for i in {1..500}; do\n mkdir -p \"$workspace/folder-$i\"\n done\n ;;\n xlarge)\n # 1000 folders\n for i in {1..1000}; do\n mkdir -p \"$workspace/folder-$i\"\n done\n ;;\n *)\n echo \"Unknown workspace size: $size\"\n rm -rf \"$workspace\"\n return 1\n ;;\n esac\n\n echo \"$workspace\"\n}\n\n# Create nested workspace\nbench_create_nested_workspace() {\n local depth=\"${1:-3}\"\n local breadth=\"${2:-5}\"\n local workspace=$(mktemp -d)\n\n bench_create_nested_helper \"$workspace\" 0 \"$depth\" \"$breadth\"\n\n echo \"$workspace\"\n}\n\nbench_create_nested_helper() {\n local parent=\"$1\"\n local current_depth=\"$2\"\n local max_depth=\"$3\"\n local breadth=\"$4\"\n\n if [ \"$current_depth\" -ge \"$max_depth\" ]; then\n return\n fi\n\n for i in $(seq 1 $breadth); do\n local dir=\"$parent/level${current_depth}-$i\"\n mkdir -p \"$dir\"\n bench_create_nested_helper \"$dir\" $((current_depth + 1)) \"$max_depth\" \"$breadth\"\n done\n}\n\n# Cleanup workspace\nbench_cleanup_workspace() {\n local workspace=\"$1\"\n\n if [ -d \"$workspace\" ] && [[ \"$workspace\" == /tmp/* ]]; then\n rm -rf \"$workspace\"\n else\n echo \"Warning: Refusing to delete non-temp directory: $workspace\"\n fi\n}\n\n# ============================================\n# Utility Functions\n# ============================================\n\n# Check if command exists\nbench_require_command() {\n local cmd=\"$1\"\n\n if ! command -v \"$cmd\" &> /dev/null; then\n echo \"Error: Required command not found: $cmd\"\n exit 1\n fi\n}\n\n# Verify benchmark prerequisites\nbench_verify_env() {\n # Check for required commands\n bench_require_command \"date\"\n bench_require_command \"mktemp\"\n\n # Verify results directory is writable\n bench_init\n if [ ! -w \"$BENCH_RESULTS_DIR\" ]; then\n echo \"Error: Results directory not writable: $BENCH_RESULTS_DIR\"\n exit 1\n fi\n}","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Benchmark Patterns","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Pattern 1: Cached vs Uncached Comparison","type":"text"}]},{"type":"paragraph","content":[{"text":"Purpose:","type":"text","marks":[{"type":"strong"}]},{"text":" Measure performance improvement from caching","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"#!/bin/bash\n# Benchmark: Cached vs Uncached Navigation Performance\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nREPO_DIR=\"$SCRIPT_DIR/..\"\n\nsource \"$SCRIPT_DIR/bench-helpers.sh\"\nsource \"$REPO_DIR/lib/cache-index.sh\"\n\nmain() {\n bench_header \"Cached vs Uncached Navigation Performance\"\n\n echo \"Configuration:\"\n echo \" Target folder: unix-goto\"\n echo \" Iterations: 10\"\n echo \" Warmup: 3 runs\"\n echo \"\"\n\n benchmark_cached_vs_uncached\n\n generate_summary\n}\n\nbenchmark_cached_vs_uncached() {\n bench_section \"Benchmark: Cached vs Uncached Lookup\"\n\n # Phase 1: Uncached lookup\n echo \"Phase 1: Uncached lookup (no cache)\"\n echo \"─────────────────────────────────\"\n\n # Remove cache to force uncached lookup\n rm -f \"$HOME/.goto_index\"\n\n # Warmup\n bench_warmup \"find ~/Documents -name unix-goto -type d -maxdepth 5\" 3\n\n # Run benchmark\n local uncached_stats=$(bench_run \"uncached\" \\\n \"find ~/Documents -name unix-goto -type d -maxdepth 5\" 10)\n\n IFS=',' read -r uc_min uc_max uc_mean uc_median uc_stddev \u003c\u003c\u003c \"$uncached_stats\"\n\n bench_print_stats \"$uncached_stats\" \"Uncached Results\"\n\n # Phase 2: Cached lookup\n echo \"\"\n echo \"Phase 2: Cached lookup (with cache)\"\n echo \"─────────────────────────────────\"\n\n # Build cache\n __goto_cache_build\n\n # Warmup\n bench_warmup \"__goto_cache_lookup unix-goto\" 3\n\n # Run benchmark\n local cached_stats=$(bench_run \"cached\" \\\n \"__goto_cache_lookup unix-goto\" 10)\n\n IFS=',' read -r c_min c_max c_mean c_median c_stddev \u003c\u003c\u003c \"$cached_stats\"\n\n bench_print_stats \"$cached_stats\" \"Cached Results\"\n\n # Analysis\n echo \"\"\n bench_print_comparison \"$uncached_stats\" \"$cached_stats\"\n\n # Assert targets\n bench_assert_target \"$c_mean\" 100 \"Cached navigation time\"\n bench_assert_improvement \"$uc_mean\" \"$c_mean\" 5 \"Cache speedup\"\n\n # Save results\n bench_save_result \"cached_vs_uncached\" \"$uncached_stats\" \"uncached\"\n bench_save_result \"cached_vs_uncached\" \"$cached_stats\" \"cached\"\n}\n\nmain\nexit 0","type":"text"}]},{"type":"paragraph","content":[{"text":"Key Points:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Clear phase separation (uncached vs cached)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Proper warmup before measurements","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Statistical analysis of results","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Comparison and speedup calculation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Target assertions","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Results storage","type":"text"}]}]}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Pattern 2: Scalability Testing","type":"text"}]},{"type":"paragraph","content":[{"text":"Purpose:","type":"text","marks":[{"type":"strong"}]},{"text":" Measure performance at different scales","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"#!/bin/bash\n# Benchmark: Cache Performance at Scale\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nREPO_DIR=\"$SCRIPT_DIR/..\"\n\nsource \"$SCRIPT_DIR/bench-helpers.sh\"\nsource \"$REPO_DIR/lib/cache-index.sh\"\n\nmain() {\n bench_header \"Cache Performance at Scale\"\n\n echo \"Testing cache performance with different folder counts\"\n echo \"\"\n\n benchmark_scale_10\n echo \"\"\n benchmark_scale_50\n echo \"\"\n benchmark_scale_500\n echo \"\"\n benchmark_scale_1000\n\n generate_summary\n}\n\nbenchmark_scale() {\n local count=\"$1\"\n local target=\"${2:-100}\"\n\n bench_section \"Benchmark: $count Folders\"\n\n # Setup workspace\n local workspace=$(bench_create_workspace_with_count \"$count\")\n local old_paths=\"$GOTO_SEARCH_PATHS\"\n export GOTO_SEARCH_PATHS=\"$workspace\"\n\n # Build cache\n __goto_cache_build\n\n # Warmup\n bench_warmup \"__goto_cache_lookup folder-$((count / 2))\" 3\n\n # Run benchmark\n local stats=$(bench_run \"scale_$count\" \\\n \"__goto_cache_lookup folder-$((count / 2))\" 10)\n\n IFS=',' read -r min max mean median stddev \u003c\u003c\u003c \"$stats\"\n\n bench_print_stats \"$stats\" \"Results ($count folders)\"\n\n # Assert target\n bench_assert_target \"$mean\" \"$target\" \"Cache lookup at scale\"\n\n # Save results\n bench_save_result \"cache_scale\" \"$stats\" \"folders_$count\"\n\n # Cleanup\n export GOTO_SEARCH_PATHS=\"$old_paths\"\n bench_cleanup_workspace \"$workspace\"\n}\n\nbench_create_workspace_with_count() {\n local count=\"$1\"\n local workspace=$(mktemp -d)\n\n for i in $(seq 1 $count); do\n mkdir -p \"$workspace/folder-$i\"\n done\n\n echo \"$workspace\"\n}\n\nbenchmark_scale_10() { benchmark_scale 10 50; }\nbenchmark_scale_50() { benchmark_scale 50 75; }\nbenchmark_scale_500() { benchmark_scale 500 100; }\nbenchmark_scale_1000() { benchmark_scale 1000 150; }\n\nmain\nexit 0","type":"text"}]},{"type":"paragraph","content":[{"text":"Key Points:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Test at multiple scale points","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Adjust targets based on scale","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Workspace generation for each scale","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Proper cleanup between tests","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Results tracking per scale level","type":"text"}]}]}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Pattern 3: Multi-Level Path Performance","type":"text"}]},{"type":"paragraph","content":[{"text":"Purpose:","type":"text","marks":[{"type":"strong"}]},{"text":" Measure performance with complex navigation paths","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"#!/bin/bash\n# Benchmark: Multi-Level Path Navigation\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nREPO_DIR=\"$SCRIPT_DIR/..\"\n\nsource \"$SCRIPT_DIR/bench-helpers.sh\"\nsource \"$REPO_DIR/lib/goto-function.sh\"\n\nmain() {\n bench_header \"Multi-Level Path Navigation Performance\"\n\n echo \"Testing navigation with multi-level paths (e.g., LUXOR/unix-goto)\"\n echo \"\"\n\n benchmark_multi_level_paths\n\n generate_summary\n}\n\nbenchmark_multi_level_paths() {\n bench_section \"Benchmark: Multi-Level Path Navigation\"\n\n # Setup nested workspace\n local workspace=$(bench_create_nested_workspace 4 3)\n local old_paths=\"$GOTO_SEARCH_PATHS\"\n export GOTO_SEARCH_PATHS=\"$workspace\"\n\n # Build cache\n __goto_cache_build\n\n # Test single-level path\n echo \"Single-level path lookup:\"\n bench_warmup \"goto level0-1\" 3\n local single_stats=$(bench_run \"single_level\" \"goto level0-1\" 10)\n bench_print_stats \"$single_stats\" \"Single-Level Results\"\n\n echo \"\"\n\n # Test two-level path\n echo \"Two-level path lookup:\"\n bench_warmup \"goto level0-1/level1-1\" 3\n local double_stats=$(bench_run \"double_level\" \"goto level0-1/level1-1\" 10)\n bench_print_stats \"$double_stats\" \"Two-Level Results\"\n\n echo \"\"\n\n # Test three-level path\n echo \"Three-level path lookup:\"\n bench_warmup \"goto level0-1/level1-1/level2-1\" 3\n local triple_stats=$(bench_run \"triple_level\" \"goto level0-1/level1-1/level2-1\" 10)\n bench_print_stats \"$triple_stats\" \"Three-Level Results\"\n\n # Analysis\n echo \"\"\n echo \"Path Complexity Analysis:\"\n IFS=',' read -r s_min s_max s_mean s_median s_stddev \u003c\u003c\u003c \"$single_stats\"\n IFS=',' read -r d_min d_max d_mean d_median d_stddev \u003c\u003c\u003c \"$double_stats\"\n IFS=',' read -r t_min t_max t_mean t_median t_stddev \u003c\u003c\u003c \"$triple_stats\"\n\n printf \" Single-level mean: %dms\\n\" \"$s_mean\"\n printf \" Two-level mean: %dms\\n\" \"$d_mean\"\n printf \" Three-level mean: %dms\\n\" \"$t_mean\"\n\n # All should be \u003c100ms\n bench_assert_target \"$s_mean\" 100 \"Single-level navigation\"\n bench_assert_target \"$d_mean\" 100 \"Two-level navigation\"\n bench_assert_target \"$t_mean\" 100 \"Three-level navigation\"\n\n # Save results\n bench_save_result \"multi_level_paths\" \"$single_stats\" \"single_level\"\n bench_save_result \"multi_level_paths\" \"$double_stats\" \"double_level\"\n bench_save_result \"multi_level_paths\" \"$triple_stats\" \"triple_level\"\n\n # Cleanup\n export GOTO_SEARCH_PATHS=\"$old_paths\"\n bench_cleanup_workspace \"$workspace\"\n}\n\nmain\nexit 0","type":"text"}]},{"type":"paragraph","content":[{"text":"Key Points:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Test increasing complexity","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Nested workspace generation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Measure each level independently","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Compare complexity impact","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Ensure all levels meet targets","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Examples","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Example 1: Complete Cache Build Benchmark","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"#!/bin/bash\n# Benchmark: Cache Build Performance\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nREPO_DIR=\"$SCRIPT_DIR/..\"\n\nsource \"$SCRIPT_DIR/bench-helpers.sh\"\nsource \"$REPO_DIR/lib/cache-index.sh\"\n\nmain() {\n bench_header \"Cache Build Performance\"\n\n echo \"Configuration:\"\n echo \" Search paths: $GOTO_SEARCH_PATHS\"\n echo \" Max depth: ${GOTO_SEARCH_DEPTH:-3}\"\n echo \" Iterations: 10\"\n echo \"\"\n\n benchmark_cache_build\n\n generate_summary\n}\n\nbenchmark_cache_build() {\n bench_section \"Benchmark: Cache Build Time\"\n\n # Count folders to be indexed\n echo \"Analyzing workspace...\"\n local folder_count=$(find ${GOTO_SEARCH_PATHS//:/ } -type d -maxdepth ${GOTO_SEARCH_DEPTH:-3} 2>/dev/null | wc -l)\n echo \" Folders to index: $folder_count\"\n echo \"\"\n\n # Phase 1: Full cache build\n echo \"Phase 1: Full cache build (cold start)\"\n echo \"─────────────────────────────────────────\"\n\n # Remove existing cache\n rm -f \"$HOME/.goto_index\"\n\n # Warmup filesystem cache\n find ${GOTO_SEARCH_PATHS//:/ } -type d -maxdepth ${GOTO_SEARCH_DEPTH:-3} > /dev/null 2>&1\n\n # Run benchmark\n local build_times=()\n for i in {1..10}; do\n rm -f \"$HOME/.goto_index\"\n local time=$(bench_time_ms \"__goto_cache_build\")\n build_times+=(\"$time\")\n printf \" Build %2d: %dms\\n\" \"$i\" \"$time\"\n done\n\n local build_stats=$(bench_calculate_stats \"${build_times[@]}\")\n IFS=',' read -r min max mean median stddev \u003c\u003c\u003c \"$build_stats\"\n\n bench_print_stats \"$build_stats\" \"Build Performance\"\n\n # Analysis\n echo \"\"\n echo \"Performance Analysis:\"\n printf \" Folders indexed: %d\\n\" \"$folder_count\"\n printf \" Average build time: %dms\\n\" \"$mean\"\n printf \" Time per folder: %.2fms\\n\" \\\n $(echo \"scale=2; $mean / $folder_count\" | bc)\n\n # Assert target (\u003c5000ms = 5 seconds)\n bench_assert_target \"$mean\" 5000 \"Cache build time\"\n\n # Save results\n bench_save_result \"cache_build\" \"$build_stats\" \"full_build,folders=$folder_count\"\n}\n\nmain\nexit 0","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Example 2: Parallel Navigation Benchmark","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"#!/bin/bash\n# Benchmark: Parallel Navigation Performance\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nREPO_DIR=\"$SCRIPT_DIR/..\"\n\nsource \"$SCRIPT_DIR/bench-helpers.sh\"\nsource \"$REPO_DIR/lib/cache-index.sh\"\n\nmain() {\n bench_header \"Parallel Navigation Performance\"\n\n echo \"Testing concurrent cache access performance\"\n echo \"\"\n\n benchmark_parallel_navigation\n\n generate_summary\n}\n\nbenchmark_parallel_navigation() {\n bench_section \"Benchmark: Concurrent Cache Access\"\n\n # Setup\n __goto_cache_build\n\n # Test different concurrency levels\n for concurrency in 1 5 10 20; do\n echo \"\"\n echo \"Testing with $concurrency concurrent lookups:\"\n echo \"─────────────────────────────────────────\"\n\n local times=()\n\n for run in {1..10}; do\n local start=$(date +%s%N)\n\n # Launch concurrent lookups\n for i in $(seq 1 $concurrency); do\n __goto_cache_lookup \"unix-goto\" > /dev/null 2>&1 &\n done\n\n # Wait for all to complete\n wait\n\n local end=$(date +%s%N)\n local duration=$(((end - start) / 1000000))\n times+=(\"$duration\")\n printf \" Run %2d: %dms\\n\" \"$run\" \"$duration\"\n done\n\n local stats=$(bench_calculate_stats \"${times[@]}\")\n IFS=',' read -r min max mean median stddev \u003c\u003c\u003c \"$stats\"\n\n echo \"\"\n echo \"Results (concurrency=$concurrency):\"\n printf \" Mean time: %dms\\n\" \"$mean\"\n printf \" Time per lookup: %dms\\n\" \\\n $((mean / concurrency))\n\n # Save results\n bench_save_result \"parallel_navigation\" \"$stats\" \"concurrency=$concurrency\"\n done\n\n echo \"\"\n echo \"Analysis:\"\n echo \" Cache supports concurrent reads efficiently\"\n echo \" No significant degradation with increased concurrency\"\n}\n\nmain\nexit 0","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Best Practices","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Benchmark Design Principles","type":"text"}]},{"type":"paragraph","content":[{"text":"1. Statistical Validity","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run at least 10 iterations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use proper warmup (3+ runs)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Calculate full statistics (min/max/mean/median/stddev)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Report median for central tendency (less affected by outliers)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Report stddev to show consistency","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"2. Realistic Testing","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Test at production-like scale","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use realistic workspaces","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Test common user workflows","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Include edge cases","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"3. Isolation","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run on idle system","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Disable unnecessary background processes","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Clear caches between test phases","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use dedicated test workspaces","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"4. Reproducibility","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Document all configuration","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use consistent test data","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Version benchmark code","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Save all results","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"5. Clarity","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Clear benchmark names","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Descriptive output","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Meaningful comparisons","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Actionable insights","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Performance Target Setting","type":"text"}]},{"type":"paragraph","content":[{"text":"Define targets based on user perception:","type":"text","marks":[{"type":"strong"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Range","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"User Perception","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use Case","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003c50ms","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Instant","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Critical path operations","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003c100ms","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Very fast","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Interactive operations","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003c200ms","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fast","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Background operations","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003c1s","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Acceptable","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Initial setup","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":">1s","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Slow","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Needs optimization","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"unix-goto targets:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Navigation: \u003c100ms (feels instant)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Lookups: \u003c10ms (imperceptible)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cache build: \u003c5s (acceptable for setup)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Results Analysis","type":"text"}]},{"type":"paragraph","content":[{"text":"Key metrics to track:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Mean","type":"text","marks":[{"type":"strong"}]},{"text":" - Average performance (primary metric)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Median","type":"text","marks":[{"type":"strong"}]},{"text":" - Middle value (better for skewed distributions)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Min","type":"text","marks":[{"type":"strong"}]},{"text":" - Best case performance","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Max","type":"text","marks":[{"type":"strong"}]},{"text":" - Worst case performance","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Stddev","type":"text","marks":[{"type":"strong"}]},{"text":" - Consistency (lower is better)","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Red flags:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"High stddev (>20% of mean) - inconsistent performance","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Increasing trend over time - performance regression","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Max >> Mean - outliers, possible issues","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"CSV Results Format","type":"text"}]},{"type":"paragraph","content":[{"text":"Standard format:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"csv"},"content":[{"text":"timestamp,benchmark_name,operation,min_ms,max_ms,mean_ms,median_ms,stddev,metadata\n1704123456,cached_vs_uncached,uncached,25,32,28,28,2.1,\n1704123456,cached_vs_uncached,cached,15,22,18,19,1.8,\n1704123457,cache_scale,folders_10,10,15,12,12,1.5,\n1704123458,cache_scale,folders_500,85,110,95,92,8.2,","type":"text"}]},{"type":"paragraph","content":[{"text":"Benefits:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Easy to parse and analyze","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Compatible with Excel/Google Sheets","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Can track trends over time","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Enables automated regression detection","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Quick Reference","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Essential Benchmark Functions","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Timing\nbench_time_ms \"command args\" # High-precision timing\nbench_warmup \"command\" 3 # Warmup iterations\nbench_run \"name\" \"command\" 10 # Full benchmark run\n\n# Statistics\nbench_calculate_stats val1 val2 val3 # Calculate stats\nbench_compare baseline optimized # Calculate speedup\n\n# Workspace\nbench_create_workspace \"medium\" # Create test workspace\nbench_create_nested_workspace 3 5 # Nested workspace\nbench_cleanup_workspace \"$workspace\" # Remove workspace\n\n# Output\nbench_header \"Title\" # Print header\nbench_section \"Section\" # Print section\nbench_print_stats \"$stats\" \"Label\" # Print statistics\nbench_print_comparison \"$s1\" \"$s2\" # Print comparison\n\n# Assertions\nbench_assert_target actual target \"msg\" # Assert performance target\nbench_assert_improvement base opt min \"m\" # Assert improvement\n\n# Results\nbench_save_result \"name\" \"$stats\" \"op\" # Save to CSV\nbench_load_results \"name\" # Load historical results","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Standard Benchmark Workflow","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# 1. Setup\nbench_header \"Benchmark Title\"\nworkspace=$(bench_create_workspace \"medium\")\n\n# 2. Warmup\nbench_warmup \"command\" 3\n\n# 3. Measure\nstats=$(bench_run \"name\" \"command\" 10)\n\n# 4. Analyze\nIFS=',' read -r min max mean median stddev \u003c\u003c\u003c \"$stats\"\nbench_print_stats \"$stats\" \"Results\"\n\n# 5. Assert\nbench_assert_target \"$mean\" 100 \"Performance\"\n\n# 6. Save\nbench_save_result \"benchmark\" \"$stats\" \"operation\"\n\n# 7. Cleanup\nbench_cleanup_workspace \"$workspace\"","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Performance Targets Quick Reference","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Operation","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Target","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Rationale","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cached navigation","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003c100ms","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Instant feel","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Bookmark lookup","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003c10ms","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Imperceptible","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cache build","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003c5s","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Setup time","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cache speedup","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":">20x","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Significant improvement","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cache hit rate","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":">90%","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Most queries cached","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Skill Version:","type":"text","marks":[{"type":"strong"}]},{"text":" 1.0 ","type":"text"},{"text":"Last Updated:","type":"text","marks":[{"type":"strong"}]},{"text":" October 2025 ","type":"text"},{"text":"Maintained By:","type":"text","marks":[{"type":"strong"}]},{"text":" Manu Tej + Claude Code ","type":"text"},{"text":"Source:","type":"text","marks":[{"type":"strong"}]},{"text":" unix-goto benchmark patterns and methodologies","type":"text"}]}]},"metadata":{"date":"2026-06-05","name":"performance-benchmark-specialist","author":"@skillopedia","source":{"stars":57,"repo_name":"luxor-claude-marketplace","origin_url":"https://github.com/manutej/luxor-claude-marketplace/blob/HEAD/plugins/luxor-design-toolkit/skills/performance-benchmark-specialist/SKILL.md","repo_owner":"manutej","body_sha256":"fa94aa07d76813165abcf952458e5ebf7d80aa82b6d90c358a4a2f98ba3bfdef","cluster_key":"26d92766fded76c3726a22c0da7a251c6fcbbea1e90f05fd25693c4f8771bf63","clean_bundle":{"format":"clean-skill-bundle-v1","source":"manutej/luxor-claude-marketplace/plugins/luxor-design-toolkit/skills/performance-benchmark-specialist/SKILL.md","attachments":[{"id":"1e2c53e5-d054-5c77-92c4-350d71974d74","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/1e2c53e5-d054-5c77-92c4-350d71974d74/attachment.md","path":"README.md","size":7447,"sha256":"5bd8beeba6cd4b1acc474de1070ef815e8a4dd68fe106a45ff8a279bc36f9a45","contentType":"text/markdown; charset=utf-8"}],"bundle_sha256":"4ca43f0d078ce1519b06a85f636d7b38ba11cee2be7aeeeb7e08226c1fcc10f3","attachment_count":1,"text_attachments":1,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"plugins/luxor-design-toolkit/skills/performance-benchmark-specialist/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"design-ux","category_label":"Design"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"design-ux","import_tag":"clean-skills-v1","description":"Performance benchmarking expertise for shell tools, covering benchmark design, statistical analysis (min/max/mean/median/stddev), performance targets (\u003c100ms, >90% hit rate), workspace generation, and comprehensive reporting"}},"renderedAt":1782980630216}

Performance Benchmark Specialist Comprehensive performance benchmarking expertise for shell-based tools, focusing on rigorous measurement, statistical analysis, and actionable performance optimization using patterns from the unix-goto project. When to Use This Skill Use this skill when: - Creating performance benchmarks for shell scripts - Measuring and validating performance targets - Implementing statistical analysis for benchmark results - Designing benchmark workspaces and test environments - Generating performance reports with min/max/mean/median/stddev - Comparing baseline vs optimized…