Skip to content

Commit

Permalink
Monkey patch benchmark Ruby 1.9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Jul 4, 2012
1 parent 9c9620b commit 8bab1e5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion benchmark/benchmark.rb
Expand Up @@ -23,6 +23,12 @@
I18n::Backend::Simple.send(:include, I18n::Backend::InterpolationCompiler)
I18n::Backend::Simple.send(:include, I18n::Backend::Flatten)

class Array
def nitems
count {|i| !i.nil?}
end
end

RBench.run(1000) do

column :r18n, :title => 'R18n'
Expand Down Expand Up @@ -82,7 +88,7 @@
r18n {
R18n.get.user.count(51)
}
i18n {
i18n {
I18n.t :'user.count', :count => 51
}
end
Expand Down

0 comments on commit 8bab1e5

Please sign in to comment.