## run-all-benchmarks.pkg

# Compiled by:
#     src/app/benchmarks/benchmarks.lib

stipulate
    package bj  =  benchmark_junk;						# benchmark_junk		is from   src/app/benchmarks/benchmark-junk.pkg
herein

    package run_all_benchmarks {
	#
	fun run_all_benchmarks ()
	    =
	    {
		r =  ([]:  List( bj::Benchmark_Result ));

		# Linux times seem accurate to about 4ms
		# so I tweak these to run about    400ms each
		# to give us times accurate to roughly +-1%:

		r =                            tagged_int_loop::run_benchmark 200000000    !  r;		# tagged_int_loop				is from   src/app/benchmarks/tagged-int-loop.pkg
		r =                          one_word_int_loop::run_benchmark 200000000    !  r;		# one_word_int_loop				is from   src/app/benchmarks/one-word-int-loop.pkg
		r =                           tagged_int_loops::run_benchmark 200	   !  r;		# tagged_int_loops				is from   src/app/benchmarks/tagged-int-loops.pkg
		r =                         one_word_int_loops::run_benchmark 200	   !  r;		# one_word_int_loops				is from   src/app/benchmarks/one-word-int-loops.pkg

		r =     tagged_int_loop_with_overflow_trapping::run_benchmark 200000000    !  r;		# tagged_int_loop				is from   src/app/benchmarks/tagged-int-loop.pkg
		r =   one_word_int_loop_with_overflow_trapping::run_benchmark 200000000    !  r;		# one_word_int_loop				is from   src/app/benchmarks/one-word-int-loop.pkg
		r =    tagged_int_loops_with_overflow_trapping::run_benchmark 200	   !  r;		# tagged_int_loops				is from   src/app/benchmarks/tagged-int-loops.pkg
		r =  one_word_int_loops_with_overflow_trapping::run_benchmark 200	   !  r;		# one_word_int_loops				is from   src/app/benchmarks/one-word-int-loops.pkg

		r =                       tagged_int_shellsort::run_benchmark 15000000	   !  r;		# tagged_int_shellsort				is from   src/app/benchmarks/tagged-int-shellsort.pkg
		r =    tagged_int_shellsort_no_bounds_checking::run_benchmark 15000000	   !  r;		# tagged_int_shellsort_no_bounds_checking	is from   src/app/benchmarks/tagged-int-shellsort.pkg

		bj::summarize_all_benchmarks (reverse r);
	    };

										my _ =
	run_all_benchmarks ();

    };
end;
