Skip to content

Performance over time

How ModifiedDistributions's benchmark suites have moved across recent revisions: an overall summary across the package first, then one section per suite.

Summary

Each benchmark suite's headline timing across recent revisions.

Not enough comparable revisions to compute ratios yet — the summary populates once a second revision is benchmarked.

Tables below show the most recent 1 revision, columns labelled by commit date.

AD gradients

Time

Benchmark32ea6df784e6a8...
Affine LogNormal scale+shift logpdf/Enzyme forward8.35 ± 0.1 μs
Affine LogNormal scale+shift logpdf/Enzyme reverse2.99 ± 0.052 μs
Affine LogNormal scale+shift logpdf/ForwardDiff0.749 ± 0.094 μs
Affine LogNormal scale+shift logpdf/Mooncake forward6.72 ± 0.31 μs
Affine LogNormal scale+shift logpdf/Mooncake reverse18 ± 0.74 μs
Affine LogNormal scale+shift logpdf/ReverseDiff (tape)16.4 ± 0.42 μs
Modified LogNormal identity-link logpdf/Enzyme forward8.66 ± 0.083 μs
Modified LogNormal identity-link logpdf/Enzyme reverse5.86 ± 1.1 μs
Modified LogNormal identity-link logpdf/ForwardDiff0.992 ± 0.019 μs
Modified LogNormal identity-link logpdf/Mooncake forward8.27 ± 0.16 μs
Modified LogNormal identity-link logpdf/Mooncake reverse0.0428 ± 0.0051 ms
Modified LogNormal identity-link logpdf/ReverseDiff (tape)0.0324 ± 0.00061 ms
Modified LogNormal log-link logpdf/Enzyme forward8.5 ± 0.08 μs
Modified LogNormal log-link logpdf/Enzyme reverse3.52 ± 0.059 μs
Modified LogNormal log-link logpdf/ForwardDiff0.905 ± 0.092 μs
Modified LogNormal log-link logpdf/Mooncake forward7.42 ± 0.14 μs
Modified LogNormal log-link logpdf/Mooncake reverse0.0405 ± 0.004 ms
Modified LogNormal log-link logpdf/ReverseDiff (tape)27.3 ± 0.53 μs
Product{Weighted} LogNormal vector logpdf/Enzyme forward8.28 ± 0.18 μs
Product{Weighted} LogNormal vector logpdf/Enzyme reverse1.02 ± 0.25 μs
Product{Weighted} LogNormal vector logpdf/ForwardDiff0.884 ± 0.065 μs
Product{Weighted} LogNormal vector logpdf/Mooncake forward7.22 ± 0.95 μs
Product{Weighted} LogNormal vector logpdf/Mooncake reverse28.2 ± 2 μs
Product{Weighted} LogNormal vector logpdf/ReverseDiff (tape)16.6 ± 0.41 μs
Thinned convolved series sum/Enzyme forward10.6 ± 0.16 μs
Thinned convolved series sum/Enzyme reverse14.3 ± 0.18 μs
Thinned convolved series sum/ForwardDiff3.25 ± 0.044 μs
Thinned convolved series sum/Mooncake forward12.2 ± 0.4 μs
Thinned convolved series sum/Mooncake reverse30.3 ± 5 μs
Thinned convolved series sum/ReverseDiff (tape)0.0373 ± 0.00079 ms
Transformed cumulative LogNormal logpdf/Enzyme forward8 ± 0.07 μs
Transformed cumulative LogNormal logpdf/Enzyme reverse1.95 ± 0.038 μs
Transformed cumulative LogNormal logpdf/ForwardDiff0.505 ± 0.073 μs
Transformed cumulative LogNormal logpdf/Mooncake forward5.4 ± 0.25 μs
Transformed cumulative LogNormal logpdf/Mooncake reverse24.2 ± 6.6 μs
Transformed cumulative LogNormal logpdf/ReverseDiff (tape)15 ± 0.41 μs
Transformed thin LogNormal logpdf/Enzyme forward8.02 ± 0.07 μs
Transformed thin LogNormal logpdf/Enzyme reverse1.96 ± 0.039 μs
Transformed thin LogNormal logpdf/ForwardDiff0.512 ± 0.071 μs
Transformed thin LogNormal logpdf/Mooncake forward5.46 ± 0.51 μs
Transformed thin LogNormal logpdf/Mooncake reverse23.9 ± 6.6 μs
Transformed thin LogNormal logpdf/ReverseDiff (tape)14.9 ± 0.39 μs
Weighted Affine LogNormal nested logpdf/Enzyme forward8.18 ± 0.097 μs
Weighted Affine LogNormal nested logpdf/Enzyme reverse0.951 ± 0.075 μs
Weighted Affine LogNormal nested logpdf/ForwardDiff0.78 ± 0.085 μs
Weighted Affine LogNormal nested logpdf/Mooncake forward7.29 ± 0.17 μs
Weighted Affine LogNormal nested logpdf/Mooncake reverse19.2 ± 0.86 μs
Weighted Affine LogNormal nested logpdf/ReverseDiff (tape)18.3 ± 0.43 μs
Weighted LogNormal observation-time weight logpdf/Enzyme forward7.92 ± 0.065 μs
Weighted LogNormal observation-time weight logpdf/Enzyme reverse1.28 ± 0.32 μs
Weighted LogNormal observation-time weight logpdf/ForwardDiff0.558 ± 0.074 μs
Weighted LogNormal observation-time weight logpdf/Mooncake forward6.02 ± 0.67 μs
Weighted LogNormal observation-time weight logpdf/Mooncake reverse29.5 ± 2.7 μs
Weighted LogNormal observation-time weight logpdf/ReverseDiff (tape)17.2 ± 0.43 μs
Weighted LogNormal scalar logpdf/Enzyme forward7.94 ± 0.068 μs
Weighted LogNormal scalar logpdf/Enzyme reverse1.3 ± 0.3 μs
Weighted LogNormal scalar logpdf/ForwardDiff0.545 ± 0.068 μs
Weighted LogNormal scalar logpdf/Mooncake forward5.98 ± 0.66 μs
Weighted LogNormal scalar logpdf/Mooncake reverse0.0361 ± 0.0031 ms
Weighted LogNormal scalar logpdf/ReverseDiff (tape)17 ± 0.43 μs
Weighted Sequential observed-total logpdf/Enzyme forward0.115 ± 0.0028 ms
Weighted Sequential observed-total logpdf/Enzyme reverse0.353 ± 0.034 ms
Weighted Sequential observed-total logpdf/ForwardDiff0.0831 ± 0.00096 ms
Weighted Sequential observed-total logpdf/Mooncake forward0.416 ± 0.024 ms
Weighted Sequential observed-total logpdf/Mooncake reverse1.3 ± 0.072 ms
Weighted Sequential observed-total logpdf/ReverseDiff (tape)2.33 ± 0.3 ms

Memory

Benchmark32ea6df784e6a8...
Affine LogNormal scale+shift logpdf/Enzyme forward0.044 k allocs: 1.52 kB
Affine LogNormal scale+shift logpdf/Enzyme reverse24 allocs: 0.969 kB
Affine LogNormal scale+shift logpdf/ForwardDiff7 allocs: 0.484 kB
Affine LogNormal scale+shift logpdf/Mooncake forward0.07 k allocs: 3.33 kB
Affine LogNormal scale+shift logpdf/Mooncake reverse0.292 k allocs: 13.5 kB
Affine LogNormal scale+shift logpdf/ReverseDiff (tape)0.248 k allocs: 10.6 kB
Modified LogNormal identity-link logpdf/Enzyme forward0.04 k allocs: 1.25 kB
Modified LogNormal identity-link logpdf/Enzyme reverse28 allocs: 3.41 kB
Modified LogNormal identity-link logpdf/ForwardDiff7 allocs: 0.359 kB
Modified LogNormal identity-link logpdf/Mooncake forward0.064 k allocs: 3.06 kB
Modified LogNormal identity-link logpdf/Mooncake reverse0.485 k allocs: 0.0416 MB
Modified LogNormal identity-link logpdf/ReverseDiff (tape)0.465 k allocs: 17.8 kB
Modified LogNormal log-link logpdf/Enzyme forward0.04 k allocs: 1.25 kB
Modified LogNormal log-link logpdf/Enzyme reverse24 allocs: 0.969 kB
Modified LogNormal log-link logpdf/ForwardDiff7 allocs: 0.359 kB
Modified LogNormal log-link logpdf/Mooncake forward0.064 k allocs: 3.06 kB
Modified LogNormal log-link logpdf/Mooncake reverse0.439 k allocs: 0.039 MB
Modified LogNormal log-link logpdf/ReverseDiff (tape)0.377 k allocs: 14.9 kB
Product{Weighted} LogNormal vector logpdf/Enzyme forward0.053 k allocs: 2.31 kB
Product{Weighted} LogNormal vector logpdf/Enzyme reverse16 allocs: 0.922 kB
Product{Weighted} LogNormal vector logpdf/ForwardDiff15 allocs: 1.06 kB
Product{Weighted} LogNormal vector logpdf/Mooncake forward0.116 k allocs: 6.31 kB
Product{Weighted} LogNormal vector logpdf/Mooncake reverse0.372 k allocs: 23.5 kB
Product{Weighted} LogNormal vector logpdf/ReverseDiff (tape)0.239 k allocs: 10 kB
Thinned convolved series sum/Enzyme forward0.043 k allocs: 1.86 kB
Thinned convolved series sum/Enzyme reverse0.036 k allocs: 1.86 kB
Thinned convolved series sum/ForwardDiff13 allocs: 0.922 kB
Thinned convolved series sum/Mooncake forward0.094 k allocs: 4.89 kB
Thinned convolved series sum/Mooncake reverse0.263 k allocs: 21.5 kB
Thinned convolved series sum/ReverseDiff (tape)0.486 k allocs: 19.4 kB
Transformed cumulative LogNormal logpdf/Enzyme forward0.036 k allocs: 1.11 kB
Transformed cumulative LogNormal logpdf/Enzyme reverse14 allocs: 0.609 kB
Transformed cumulative LogNormal logpdf/ForwardDiff7 allocs: 0.266 kB
Transformed cumulative LogNormal logpdf/Mooncake forward0.058 k allocs: 2.91 kB
Transformed cumulative LogNormal logpdf/Mooncake reverse0.274 k allocs: 25.6 kB
Transformed cumulative LogNormal logpdf/ReverseDiff (tape)0.213 k allocs: 9.06 kB
Transformed thin LogNormal logpdf/Enzyme forward0.036 k allocs: 1.11 kB
Transformed thin LogNormal logpdf/Enzyme reverse14 allocs: 0.609 kB
Transformed thin LogNormal logpdf/ForwardDiff7 allocs: 0.266 kB
Transformed thin LogNormal logpdf/Mooncake forward0.058 k allocs: 2.91 kB
Transformed thin LogNormal logpdf/Mooncake reverse0.274 k allocs: 25.6 kB
Transformed thin LogNormal logpdf/ReverseDiff (tape)0.213 k allocs: 9.06 kB
Weighted Affine LogNormal nested logpdf/Enzyme forward0.036 k allocs: 1.38 kB
Weighted Affine LogNormal nested logpdf/Enzyme reverse6 allocs: 0.484 kB
Weighted Affine LogNormal nested logpdf/ForwardDiff7 allocs: 0.516 kB
Weighted Affine LogNormal nested logpdf/Mooncake forward0.08 k allocs: 4.02 kB
Weighted Affine LogNormal nested logpdf/Mooncake reverse0.329 k allocs: 15.6 kB
Weighted Affine LogNormal nested logpdf/ReverseDiff (tape)0.269 k allocs: 11.3 kB
Weighted LogNormal observation-time weight logpdf/Enzyme forward0.032 k allocs: 1.05 kB
Weighted LogNormal observation-time weight logpdf/Enzyme reverse10 allocs: 1.14 kB
Weighted LogNormal observation-time weight logpdf/ForwardDiff7 allocs: 0.297 kB
Weighted LogNormal observation-time weight logpdf/Mooncake forward0.068 k allocs: 3.59 kB
Weighted LogNormal observation-time weight logpdf/Mooncake reverse0.32 k allocs: 0.0353 MB
Weighted LogNormal observation-time weight logpdf/ReverseDiff (tape)0.239 k allocs: 9.97 kB
Weighted LogNormal scalar logpdf/Enzyme forward0.032 k allocs: 1.05 kB
Weighted LogNormal scalar logpdf/Enzyme reverse10 allocs: 1.14 kB
Weighted LogNormal scalar logpdf/ForwardDiff7 allocs: 0.297 kB
Weighted LogNormal scalar logpdf/Mooncake forward0.068 k allocs: 3.59 kB
Weighted LogNormal scalar logpdf/Mooncake reverse0.348 k allocs: 0.0453 MB
Weighted LogNormal scalar logpdf/ReverseDiff (tape)0.239 k allocs: 9.97 kB
Weighted Sequential observed-total logpdf/Enzyme forward0.668 k allocs: 26 kB
Weighted Sequential observed-total logpdf/Enzyme reverse2.03 k allocs: 0.0977 MB
Weighted Sequential observed-total logpdf/ForwardDiff0.198 k allocs: 10.1 kB
Weighted Sequential observed-total logpdf/Mooncake forward1.65 k allocs: 0.0702 MB
Weighted Sequential observed-total logpdf/Mooncake reverse8.5 k allocs: 0.854 MB
Weighted Sequential observed-total logpdf/ReverseDiff (tape)31.3 k allocs: 1.29 MB

Affine

Time

Benchmark32ea6df784e6a8...
LogNormal/ccdf3.29 ± 0.37 μs
LogNormal/cdf3.38 ± 0.33 μs
LogNormal/construction3.1 ± 0.01 ns
LogNormal/logpdf2.65 ± 0.33 μs
LogNormal/pdf4.09 ± 0.23 μs
LogNormal/quantile0.488 ± 0.017 μs
LogNormal/rand1.24 ± 0.069 μs

Memory

Benchmark32ea6df784e6a8...
LogNormal/ccdf2 allocs: 0.906 kB
LogNormal/cdf2 allocs: 0.906 kB
LogNormal/construction0 allocs: 0 B
LogNormal/logpdf2 allocs: 0.906 kB
LogNormal/pdf2 allocs: 0.906 kB
LogNormal/quantile2 allocs: 0.219 kB
LogNormal/rand2 allocs: 0.906 kB

Baseline

Time

Benchmark32ea6df784e6a8...
LogNormal/ccdf2.67 ± 0.32 μs
LogNormal/cdf2.65 ± 0.34 μs
LogNormal/construction1.55 ± 0.01 ns
LogNormal/logpdf1.66 ± 0.29 μs
LogNormal/pdf2.97 ± 0.32 μs
LogNormal/quantile0.466 ± 0.018 μs
LogNormal/rand1.02 ± 0.032 μs

Memory

Benchmark32ea6df784e6a8...
LogNormal/ccdf2 allocs: 0.906 kB
LogNormal/cdf2 allocs: 0.906 kB
LogNormal/construction0 allocs: 0 B
LogNormal/logpdf2 allocs: 0.906 kB
LogNormal/pdf2 allocs: 0.906 kB
LogNormal/quantile2 allocs: 0.219 kB
LogNormal/rand2 allocs: 0.906 kB

Modified

Time

Benchmark32ea6df784e6a8...
IdentityLink/ccdf7.53 ± 0.025 μs
IdentityLink/cdf7.18 ± 0.03 μs
IdentityLink/construction3.41 ± 0.01 ns
IdentityLink/logpdf10.5 ± 0.06 μs
IdentityLink/pdf12.7 ± 0.051 μs
IdentityLink/quantile0.11 ± 0.0002 ms
IdentityLink/rand0.577 ± 0.015 ms
LogLink/ccdf5.79 ± 0.057 μs
LogLink/cdf6.16 ± 0.042 μs
LogLink/construction2.79 ± 0.01 ns
LogLink/logpdf8.04 ± 0.033 μs
LogLink/pdf9.33 ± 0.04 μs
LogLink/quantile0.917 ± 0.07 μs
LogLink/rand5.13 ± 0.19 μs

Memory

Benchmark32ea6df784e6a8...
IdentityLink/ccdf2 allocs: 0.906 kB
IdentityLink/cdf2 allocs: 0.906 kB
IdentityLink/construction0 allocs: 0 B
IdentityLink/logpdf2 allocs: 0.906 kB
IdentityLink/pdf2 allocs: 0.906 kB
IdentityLink/quantile2 allocs: 0.219 kB
IdentityLink/rand2 allocs: 0.906 kB
LogLink/ccdf2 allocs: 0.906 kB
LogLink/cdf2 allocs: 0.906 kB
LogLink/construction0 allocs: 0 B
LogLink/logpdf2 allocs: 0.906 kB
LogLink/pdf2 allocs: 0.906 kB
LogLink/quantile2 allocs: 0.219 kB
LogLink/rand2 allocs: 0.906 kB

Transformed

Time

Benchmark32ea6df784e6a8...
cumulative/cdf2.65 ± 0.32 μs
cumulative/construction3.1 ± 0.06 ns
cumulative/logpdf1.66 ± 0.29 μs
cumulative/rand1.02 ± 0.031 μs
thin/cdf2.66 ± 0.33 μs
thin/construction2.79 ± 0.01 ns
thin/logpdf1.66 ± 0.31 μs
thin/rand1.02 ± 0.029 μs

Memory

Benchmark32ea6df784e6a8...
cumulative/cdf2 allocs: 0.906 kB
cumulative/construction0 allocs: 0 B
cumulative/logpdf2 allocs: 0.906 kB
cumulative/rand2 allocs: 0.906 kB
thin/cdf2 allocs: 0.906 kB
thin/construction0 allocs: 0 B
thin/logpdf2 allocs: 0.906 kB
thin/rand2 allocs: 0.906 kB

Weighted

Time

Benchmark32ea6df784e6a8...
Product/construction0.294 ± 0.13 μs
Product/logpdf2.93 ± 0.19 μs
scalar/construction3.1 ± 0.01 ns
scalar/logpdf1.71 ± 0.28 μs

Memory

Benchmark32ea6df784e6a8...
Product/construction3 allocs: 2.45 kB
Product/logpdf6 allocs: 2.72 kB
scalar/construction0 allocs: 0 B
scalar/logpdf2 allocs: 0.906 kB

time_to_load

Time

Benchmark32ea6df784e6a8...
time_to_load0.618 ± 0.011 s

Memory

Benchmark32ea6df784e6a8...
time_to_load0.149 k allocs: 11.2 kB

Per-benchmark timelines

<details> <summary>Show 6 plots</summary>

plot_ModifiedDistributions_1.pngplot_ModifiedDistributions_2.pngplot_ModifiedDistributions_3.pngplot_ModifiedDistributions_4.pngplot_ModifiedDistributions_5.pngplot_ModifiedDistributions_6.png

</details>

About these benchmarks

ModifiedDistributions benchmarks each modifier's hot paths so wrapper overhead is visible and regressions are caught on every pull request.

The suite (benchmark/benchmarks.jl) evaluates construction, logpdf, pdf, cdf/ccdf, quantile and rand for every modifier around the same base LogNormal, with the bare base as the shared baseline floor:

  • Baseline: the bare base LogNormal.

  • Affine: the change-of-variables paths through Y = scale * X + shift.

  • Weighted: the logpdf weight paths, scalar and the vectorised Product{Weighted} form.

  • Transformed: thin and cumulative, whose forward ops are transparent to every distribution method, so these rows should sit on the baseline.

  • Modified: the hazard modification on both analytic links; the identity-link quantile and rand exercise the monotone-bisection cdf inversion, the one non-closed-form path.

  • AD gradients: DifferentiationInterface.gradient of every test/ADFixtures scenario across the ForwardDiff, ReverseDiff, Mooncake and Enzyme backends, sharing the fixtures that drive the AD test suite.

Run the suite locally with task benchmark, or compare against main with task benchmark-compare (see benchmark/README.md). On pull requests the benchmark workflow benchmarks head and base in separate jobs and posts a single comparison comment. Pushes to main and tags append to the performance history shown below.