1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Fix benchmark

This commit is contained in:
Takashi Kokubun 2015-03-30 20:19:07 +09:00
parent 2ff1a8bc3b
commit 6d7d5ca760

View file

@ -73,7 +73,6 @@ class Benchmarks
end
x.compare!
end
assert_fastest(result)
end
private
@ -89,20 +88,6 @@ class Benchmarks
printf "%20s %10s\n", name, "v#{version}"
end
end
def assert_fastest(result)
hamlit = result.entries.first
rival = result.entries[1..-1].max_by(&:ips)
if hamlit.ips < rival.ips
fatal "Hamlit is slower than #{rival.label}"
end
end
def fatal(message)
puts "\e[31m#{message}\e[0m"
exit 1
end
end
time = (ENV['TIME'] || 5).to_i