Skip to content

chore: Update hotpath to fix alloc profiling#171

Merged
load1n9 merged 1 commit intotryandromeda:mainfrom
pawurb:fix_alloc_profiling
Oct 20, 2025
Merged

chore: Update hotpath to fix alloc profiling#171
load1n9 merged 1 commit intotryandromeda:mainfrom
pawurb:fix_alloc_profiling

Conversation

@pawurb
Copy link
Contributor

@pawurb pawurb commented Oct 20, 2025

Hi. This PR updates hotpath to 0.5.2. By adding a hotpath-alloc-self flag, profiling memory of recursive methods is now possible. Before:

alloc-before

After:

alloc-after

@github-actions
Copy link

Performance Comparison mainfix_alloc_profiling

Total Elapsed Time: 49.62ms → 46.63ms (-6.0%)

Profiling Mode: timing - Execution duration of functions.

+-------------------------------------+----------------------+----------------------------------+----------------------------------+---------------------------------+---------------------------------+--------------------------------+------------------------------+
| Function                            | Calls                | Avg                              | P50                              | P95                             | P99                             | Total                          | % Total                      |
+-------------------------------------+----------------------+----------------------------------+----------------------------------+---------------------------------+---------------------------------+--------------------------------+------------------------------+
| andromeda::main                     | 1 → 1 (+0.0%)        | 48.93ms → 45.95ms (-6.1%)        | 48.96ms → 45.97ms (-6.1%)        | 48.96ms → 45.97ms (-6.1%)       | 48.96ms → 45.97ms (-6.1%)       | 48.93ms → 45.95ms (-6.1%)      | 100.00% → 100.00% (+0.0%)    |
+-------------------------------------+----------------------+----------------------------------+----------------------------------+---------------------------------+---------------------------------+--------------------------------+------------------------------+
| andromeda::run_main                 | 1 → 1 (+0.0%)        | 48.91ms → 45.93ms (-6.1%)        | 48.92ms → 45.94ms (-6.1%)        | 48.92ms → 45.94ms (-6.1%)       | 48.92ms → 45.94ms (-6.1%)       | 48.91ms → 45.93ms (-6.1%)      | 99.95% → 99.95% (+0.0%)      |
+-------------------------------------+----------------------+----------------------------------+----------------------------------+---------------------------------+---------------------------------+--------------------------------+------------------------------+
| run::run                            | 1 → 1 (+0.0%)        | 48.38ms → 45.47ms (-6.0%)        | 48.40ms → 45.48ms (-6.0%)        | 48.40ms → 45.48ms (-6.0%)       | 48.40ms → 45.48ms (-6.0%)       | 48.38ms → 45.47ms (-6.0%)      | 98.87% → 98.95% (+0.1%)      |
+-------------------------------------+----------------------+----------------------------------+----------------------------------+---------------------------------+---------------------------------+--------------------------------+------------------------------+
| run::create_runtime_files           | 1 → 1 (+0.0%)        | 48.38ms → 45.47ms (-6.0%)        | 48.40ms → 45.48ms (-6.0%)        | 48.40ms → 45.48ms (-6.0%)       | 48.40ms → 45.48ms (-6.0%)       | 48.38ms → 45.47ms (-6.0%)      | 98.86% → 98.94% (+0.1%)      |
+-------------------------------------+----------------------+----------------------------------+----------------------------------+---------------------------------+---------------------------------+--------------------------------+------------------------------+
| runtime::run                        | 1 → 1 (+0.0%)        | 27.58ms → 25.48ms (-7.6%)        | 27.59ms → 25.49ms (-7.6%)        | 27.59ms → 25.49ms (-7.6%)       | 27.59ms → 25.49ms (-7.6%)       | 27.58ms → 25.48ms (-7.6%)      | 56.35% → 55.44% (-1.6%)      |
+-------------------------------------+----------------------+----------------------------------+----------------------------------+---------------------------------+---------------------------------+--------------------------------+------------------------------+
| runtime::new                        | 1 → 1 (+0.0%)        | 19.35ms → 18.75ms (-3.1%)        | 19.37ms → 18.76ms (-3.1%)        | 19.37ms → 18.76ms (-3.1%)       | 19.37ms → 18.76ms (-3.1%)       | 19.35ms → 18.75ms (-3.1%)      | 39.54% → 40.81% (+3.2%)      |
+-------------------------------------+----------------------+----------------------------------+----------------------------------+---------------------------------+---------------------------------+--------------------------------+------------------------------+
| extension::load                     | 22 → 22 (+0.0%)      | 843.02µs → 821.69µs (-2.5%)      | 339.97µs → 305.66µs (-10.1%)     | 3.03ms → 2.95ms (-2.7%)         | 5.84ms → 5.68ms (-2.7%)         | 18.55ms → 18.08ms (-2.5%)      | 37.90% → 39.33% (+3.8%)      |
+-------------------------------------+----------------------+----------------------------------+----------------------------------+---------------------------------+---------------------------------+--------------------------------+------------------------------+
| console::internal_print             | 180 → 180 (+0.0%)    | 5.72µs → 4.59µs (-19.8%)         | 5.29µs → 4.87µs (-7.9%)          | 7.14µs → 6.32µs (-11.5%)        | 19.20µs → 10.54µs (-45.1%) 🚀   | 1.03ms → 826.26µs (-19.8%)     | 2.10% → 1.79% (-14.8%)       |
+-------------------------------------+----------------------+----------------------------------+----------------------------------+---------------------------------+---------------------------------+--------------------------------+------------------------------+
| recommended::recommended_extensions | 1 → 1 (+0.0%)        | 56.76µs → 46.62µs (-17.9%)       | 56.77µs → 46.62µs (-17.9%)       | 56.77µs → 46.62µs (-17.9%)      | 56.77µs → 46.62µs (-17.9%)      | 56.76µs → 46.62µs (-17.9%)     | 0.11% → 0.10% (-9.1%)        |
+-------------------------------------+----------------------+----------------------------------+----------------------------------+---------------------------------+---------------------------------+--------------------------------+------------------------------+
| console::get_group_indent           | 180 → 180 (+0.0%)    | 243.00ns → 162.00ns (-33.3%) 🚀  | 231.00ns → 160.00ns (-30.7%) 🚀  | 380.00ns → 320.00ns (-15.8%)    | 570.00ns → 461.00ns (-19.1%)    | 43.89µs → 29.28µs (-33.3%) 🚀  | 0.08% → 0.06% (-25.0%) 🚀    |
+-------------------------------------+----------------------+----------------------------------+----------------------------------+---------------------------------+---------------------------------+--------------------------------+------------------------------+

Generated with hotpath

📊 View Raw JSON Metrics

PR Metrics

{
  "hotpath_profiling_mode": "timing",
  "total_elapsed": 46627952,
  "description": "Execution duration of functions.",
  "caller_name": "andromeda::main",
  "output": {
    "run::create_runtime_files": {
      "calls": 1,
      "avg": 45471067,
      "p50": 45481983,
      "p95": 45481983,
      "p99": 45481983,
      "total": 45471067,
      "percent_total": 9894
    },
    "run::run": {
      "calls": 1,
      "avg": 45474974,
      "p50": 45481983,
      "p95": 45481983,
      "p99": 45481983,
      "total": 45474974,
      "percent_total": 9895
    },
    "console::internal_print": {
      "calls": 180,
      "avg": 4590,
      "p50": 4871,
      "p95": 6323,
      "p99": 10543,
      "total": 826256,
      "percent_total": 179
    },
    "console::get_group_indent": {
      "calls": 180,
      "avg": 162,
      "p50": 160,
      "p95": 320,
      "p99": 461,
      "total": 29278,
      "percent_total": 6
    },
    "recommended::recommended_extensions": {
      "calls": 1,
      "avg": 46618,
      "p50": 46623,
      "p95": 46623,
      "p99": 46623,
      "total": 46618,
      "percent_total": 10
    },
    "runtime::new": {
      "calls": 1,
      "avg": 18754695,
      "p50": 18759679,
      "p95": 18759679,
      "p99": 18759679,
      "total": 18754695,
      "percent_total": 4081
    },
    "andromeda::run_main": {
      "calls": 1,
      "avg": 45934289,
      "p50": 45940735,
      "p95": 45940735,
      "p99": 45940735,
      "total": 45934289,
      "percent_total": 9995
    },
    "runtime::run": {
      "calls": 1,
      "avg": 25479012,
      "p50": 25493503,
      "p95": 25493503,
      "p99": 25493503,
      "total": 25479012,
      "percent_total": 5544
    },
    "extension::load": {
      "calls": 22,
      "avg": 821694,
      "p50": 305663,
      "p95": 2949119,
      "p99": 5681151,
      "total": 18077268,
      "percent_total": 3933
    },
    "andromeda::main": {
      "calls": 1,
      "avg": 45953916,
      "p50": 45973503,
      "p95": 45973503,
      "p99": 45973503,
      "total": 45953916,
      "percent_total": 10000
    }
  }
}

Main Branch Metrics

{
  "hotpath_profiling_mode": "timing",
  "total_elapsed": 49618619,
  "description": "Execution duration of functions.",
  "caller_name": "andromeda::main",
  "output": {
    "andromeda::main": {
      "calls": 1,
      "avg": 48934636,
      "p50": 48955391,
      "p95": 48955391,
      "p99": 48955391,
      "total": 48934636,
      "percent_total": 10000
    },
    "runtime::run": {
      "calls": 1,
      "avg": 27575368,
      "p50": 27590655,
      "p95": 27590655,
      "p99": 27590655,
      "total": 27575368,
      "percent_total": 5635
    },
    "recommended::recommended_extensions": {
      "calls": 1,
      "avg": 56757,
      "p50": 56767,
      "p95": 56767,
      "p99": 56767,
      "total": 56757,
      "percent_total": 11
    },
    "run::run": {
      "calls": 1,
      "avg": 48382777,
      "p50": 48398335,
      "p95": 48398335,
      "p99": 48398335,
      "total": 48382777,
      "percent_total": 9887
    },
    "console::internal_print": {
      "calls": 180,
      "avg": 5720,
      "p50": 5291,
      "p95": 7143,
      "p99": 19199,
      "total": 1029618,
      "percent_total": 210
    },
    "extension::load": {
      "calls": 22,
      "avg": 843017,
      "p50": 339967,
      "p95": 3031039,
      "p99": 5836799,
      "total": 18546390,
      "percent_total": 3790
    },
    "andromeda::run_main": {
      "calls": 1,
      "avg": 48914538,
      "p50": 48922623,
      "p95": 48922623,
      "p99": 48922623,
      "total": 48914538,
      "percent_total": 9995
    },
    "console::get_group_indent": {
      "calls": 180,
      "avg": 243,
      "p50": 231,
      "p95": 380,
      "p99": 570,
      "total": 43887,
      "percent_total": 8
    },
    "run::create_runtime_files": {
      "calls": 1,
      "avg": 48377727,
      "p50": 48398335,
      "p95": 48398335,
      "p99": 48398335,
      "total": 48377727,
      "percent_total": 9886
    },
    "runtime::new": {
      "calls": 1,
      "avg": 19352317,
      "p50": 19365887,
      "p95": 19365887,
      "p99": 19365887,
      "total": 19352317,
      "percent_total": 3954
    }
  }
}

Copy link
Member

@marc2332 marc2332 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@load1n9 load1n9 merged commit 8a1dbe3 into tryandromeda:main Oct 20, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants