Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

run benchmarks against ruby 1.8 as well

  • Loading branch information...
commit 6d75ce6e46fbafe9139fb5b79c69a79742fc245e 1 parent 149ee42
@dchelimsky dchelimsky authored
Showing with 41 additions and 1 deletion.
  1. +41 −1 benchmarks/check_inclusion.rb
View
42 benchmarks/check_inclusion.rb
@@ -2,7 +2,7 @@
n = 10_000
-num_modules = 100
+num_modules = 1000
class Foo; end
modules = num_modules.times.map { Module.new }
@@ -48,6 +48,8 @@ class Foo; end
end
end
+#### Ruby 1.9.3
+#
# 100 modules
# < modules.first
# 0.010000 0.000000 0.010000 ( 0.005104)
@@ -83,3 +85,41 @@ class Foo; end
# 0.340000 0.000000 0.340000 ( 0.344011)
# 0.350000 0.000000 0.350000 ( 0.346277)
# 0.330000 0.000000 0.330000 ( 0.335607)
+
+#### Ruby 1.8.7
+#
+# 100 modules
+# < modules.first
+ # 0.010000 0.000000 0.010000 ( 0.007132)
+ # 0.010000 0.000000 0.010000 ( 0.006869)
+ # 0.000000 0.000000 0.000000 ( 0.005334)
+# < modules.last
+ # 0.010000 0.000000 0.010000 ( 0.003438)
+ # 0.000000 0.000000 0.000000 ( 0.003454)
+ # 0.000000 0.000000 0.000000 ( 0.003408)
+# < included_modules.include?(modules.first)
+ # 0.110000 0.010000 0.120000 ( 0.113255)
+ # 0.110000 0.000000 0.110000 ( 0.112880)
+ # 0.110000 0.000000 0.110000 ( 0.121003)
+# < included_modules.include?(modules.last)
+ # 0.040000 0.010000 0.050000 ( 0.040736)
+ # 0.040000 0.000000 0.040000 ( 0.039609)
+ # 0.030000 0.000000 0.030000 ( 0.039888)
+
+# 1000 modules
+# < modules.first
+ # 0.040000 0.000000 0.040000 ( 0.044124)
+ # 0.050000 0.000000 0.050000 ( 0.046110)
+ # 0.040000 0.000000 0.040000 ( 0.042603)
+# < modules.last
+ # 0.000000 0.000000 0.000000 ( 0.003405)
+ # 0.010000 0.000000 0.010000 ( 0.005510)
+ # 0.000000 0.000000 0.000000 ( 0.003562)
+# < included_modules.include?(modules.first)
+ # 0.990000 0.000000 0.990000 ( 1.096331)
+ # 1.030000 0.010000 1.040000 ( 1.047791)
+ # 0.990000 0.000000 0.990000 ( 1.019169)
+# < included_modules.include?(modules.last)
+ # 0.260000 0.000000 0.260000 ( 0.265306)
+ # 0.270000 0.000000 0.270000 ( 0.311985)
+ # 0.270000 0.000000 0.270000 ( 0.277936)
Please sign in to comment.
Something went wrong with that request. Please try again.