Benchmarks

March 14, 2022 ยท View on GitHub

Table of Contents

Overview

This benchmark comparison report shows the difference in performance between iterative (fib_iter) and recursive (fib_recur) fibonacci functions.

Benchmark Results

Fibonacci

Since fib_recur is not tail recursive, Rust is forced to make a function call making the recursive version MUCH slower.

Recursive FibIterative Fib
10111.67 ns (1.00x)1.38 ns (๐Ÿš€ 81.00x faster)
2014.01 us (1.00x)2.12 ns (๐Ÿš€ 6600.43x faster)
301.73 ms (1.00x)3.28 ns (๐Ÿš€ 526537.98x faster)

Made with criterion-table