scripts/benchmarking/formatters.rb in object_inspector-0.4.0 vs scripts/benchmarking/formatters.rb in object_inspector-0.5.0
- old
+ new
@@ -7,11 +7,11 @@
custom_formatter_klasses ||= []
formatter_klasses = [
ObjectInspector::TemplatingFormatter,
ObjectInspector::CombiningFormatter,
- *Array(custom_formatter_klasses),
+ *Array(custom_formatter_klasses)
]
INSPECTOR_WITH_FLAGS_AND_INFO_AND_NAME ||=
OpenStruct.new(
identification: "IDENTIFICATION",
@@ -47,11 +47,10 @@
info: "INFO")
INSPECTOR_WITH_BASE ||=
OpenStruct.new(
identification: "IDENTIFICATION")
-
puts "== Averaged ============================================================="
Benchmark.ips { |x|
formatter_klasses.each do |formatter_klass|
x.report(formatter_klass) {
formatter_klass.new(INSPECTOR_WITH_FLAGS_AND_INFO_AND_NAME).call
@@ -64,14 +63,13 @@
formatter_klass.new(INSPECTOR_WITH_BASE).call
}
end
x.compare!
-};
+}
puts "== Done"
-
puts "== Individualized ======================================================="
Benchmark.ips { |x|
formatter_klasses.each do |formatter_klass|
x.report("#{formatter_klass} - Flags and Info and Name") {
formatter_klass.new(INSPECTOR_WITH_FLAGS_AND_INFO_AND_NAME).call
@@ -112,7 +110,7 @@
formatter_klass.new(INSPECTOR_WITH_BASE).call
}
end
x.compare!
-};
+}
puts "== Done"