Permalink
Browse files

Fix bm require and import newer 1.9 const bm.

  • Loading branch information...
1 parent 4c5fec6 commit 2c338c0636d0d8e17bd3669225984bb92781c39a Brian Ford committed Mar 1, 2009
Showing with 9 additions and 8 deletions.
  1. +7 −8 benchmark/rbs/core-features/bm_vm1_const.rb
  2. +2 −0 benchmark/rbs/core-library/bm_pathname.rb
View
15 benchmark/rbs/core-features/bm_vm1_const.rb
@@ -1,11 +1,10 @@
-iter = 0
+Const = 1
+i = 0
-Bench.run [500_000] do |n|
- iter += 1
- puts iter
-
- n.times do |i|
- Object.const_set("CONST#{iter}#{i}", 1)
- const = Object.const_get("CONST#{iter}#{i}")
+Bench.run [30_000_000] do |n|
+ while i < n # while loop 1
+ i+= 1
+ j = Const
+ k = Const
end
end
View
2 benchmark/rbs/core-library/bm_pathname.rb
@@ -2,6 +2,8 @@
# recursion and the Pathname class.
# Submitted by Lukas Domagala
+require 'pathname'
+
def recursive_dir(path)
current_path = Pathname.new(path)
current_files = []

0 comments on commit 2c338c0

Please sign in to comment.