performance - Interpreting ruby's benchmark results: difference between Benchmark.bm and Benchmark.bmbm -
i testing 4 different algorithms in ruby , i"m having trouble interpreting results returned ruby's benchmark utility.
i ran each set of algorithms twice, once using benchmark.bm , again using benchmark.bmbm. here results:
benchmark.bm:
real stime total utime 1 214.91 3.44 154.93 151.48 2 208.85 3.03 161.37 158.34 3 224.40 3.23 161.63 158.41 4 234.02 3.34 163.49 160.16 benchmark.bmbm:
real stime total utime 1 252.61 3.50 163.89 160.39 2 278.56 3.65 164.61 160.96 3 241.89 3.37 162.73 159.36 4 256.12 3.56 163.91 160.35 which algorithm performs best(1,2,3 or 4) according these results? practical differences between using benchmark.bm , benchmark.bmbm.
apologies if answered elsewhere, couldn't find direct answer.
there don't seem significant differences between algorithms. what's relevant number 'total', total time spent cpu on running code. these pretty close each other.
the difference between benchmark.bm , benchmark.bmbm latter runs benchmark, throws away result, runs again , returns second run's results. reason avoid unfair disadvantage of subjects: possible there exist common resources between subjects 1 of them needs initialize, , bmbm have better chance in 'warm' state , obtain fair result.
Comments
Post a Comment