Skip to content

Commit

Permalink
run benchmarks against ruby 1.8 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Mar 4, 2012
1 parent 149ee42 commit 6d75ce6
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion benchmarks/check_inclusion.rb
Expand Up @@ -2,7 +2,7 @@

n = 10_000

num_modules = 100
num_modules = 1000

class Foo; end
modules = num_modules.times.map { Module.new }
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

0 comments on commit 6d75ce6

Please sign in to comment.