# Step method runtime comparisons

**URL:** <https://discourse.pymc.io/t/step-method-runtime-comparisons/13822>\
**Category:** Development\
**Created:** [February 19, 2024, 12:22pm UTC](https://discourse.pymc.io/t/step-method-runtime-comparisons/13822 "2024-02-19T12:22:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brandonhorsley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/brandonhorsley/32/6693_2.png) [@brandonhorsley](https://discourse.pymc.io/u/brandonhorsley)\
**Post date:** [February 19, 2024, 12:22pm UTC](https://discourse.pymc.io/t/step-method-runtime-comparisons/13822/1 "2024-02-19T12:22:18Z")

</div>

Hi all,

I am seeking to compare NUTS sampler to Metropolis for a problem of mine whereby I run NUTS for 5000 samples and Metropolis for 5000 samples to illustrate that, as expected, for the same number of samples NUTS shows a stronger convergence. However due to the nature of my problem with some tough geometries to sample from (I probably will try and reparameterise but that is a separate thing 😅), NUTS naturally spends more time calculating an optimal trajectory such that NUTS takes hours while Metropolis takes a minute or two. Now I know this is to be expected but in a naive python code like I have used where you just set the number of samples for PyMC to run to it feels like surely a fairer comparison (from an application perspective) would be to run HMC for x number of samples and then let Metropolis run for the same amount of time to then compare results?

I am posting this here partly in case I have missed a function for profiling in this way, but partly in case it could be a good discussion to have perhaps for pymc\_experimental. I am aware that there are a lot of model specific catches and caveats that cause variation in NUTS runtime (sometimes lots) that would be relevant to mention for anyone trying to naively use a strict runtime comparison but still I am curious to get input!
