1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/test/benchmark.rb
hcatlin f983380373 Fixing the active-support requirement for the benchmark too.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@57 7063305b-7217-0410-af8c-cdc13e5119b9
2006-10-02 23:39:19 +00:00

15 lines
444 B
Ruby

require 'rubygems'
require 'active_support'
require 'action_view'
require File.dirname(__FILE__) + '/../lib/haml/template'
ActionView::Base.register_template_handler("haml", Haml::Template)
@base = ActionView::Base.new(File.dirname(__FILE__))
RUNS = (ARGV[0] || 100).to_i
Benchmark.bm do |b|
b.report("haml: ") { RUNS.times { @base.render "templates/standard" } }
b.report("erb: ") { RUNS.times { @base.render "rhtml/standard" } }
end