Compute the N-th Fibonacci using three different, popular implementations:
Each version will be run in a separate benchmark stage. In order to bring the tail-recursive and the iterative versions in a measurable range (if possible at all), the implementations have to repeat the computation M times, updating a checksum according to:
checksum = 0
for i in 0 .. <M:
checksum += fibonacci_iterative(N)
checksum %= 2147483647
Benchmark aspects: Recursion
After writing the stage run times to STDOUT, the implementations should print:
Each bar corresponds to the run time of one particular stage. Use mouse-over to highlight a single stage for comparison. Only shows run times of the largest data size.
All raw run times of individual runs for small (N = 34, M = 145806), medium (N = 36, M = 306557), and large (N = 38, M = 644537) problem sizes. Use mouse-over to see relative performance.
All raw run times of individual runs for small (N = 34, M = 145806), medium (N = 36, M = 306557), and large (N = 38, M = 644537) problem sizes. Use mouse-over to see relative performance.
All raw run times of individual runs for small (N = 34, M = 145806), medium (N = 36, M = 306557), and large (N = 38, M = 644537) problem sizes. Use mouse-over to see relative performance.
All raw run times of individual runs for small (N = 34, M = 145806), medium (N = 36, M = 306557), and large (N = 38, M = 644537) problem sizes. Use mouse-over to see relative performance.