2006-08-21 03:33:30 +00:00
|
|
|
require File.dirname(__FILE__) + '/../lib/haml/engine'
|
2006-09-12 04:14:21 +00:00
|
|
|
|
2006-08-21 03:33:30 +00:00
|
|
|
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
2006-09-12 04:14:21 +00:00
|
|
|
|
2006-08-21 03:33:30 +00:00
|
|
|
require 'rubygems'
|
|
|
|
require 'action_view'
|
|
|
|
|
2006-09-12 04:14:21 +00:00
|
|
|
include Haml::Helper
|
2006-08-21 03:33:30 +00:00
|
|
|
|
2006-09-12 04:14:21 +00:00
|
|
|
ActionView::Base.register_template_handler("haml", Haml::Engine)
|
|
|
|
@base = ActionView::Base.new(File.dirname(__FILE__))
|
2006-08-21 03:33:30 +00:00
|
|
|
|
2006-09-12 04:14:21 +00:00
|
|
|
RUNS = 2000
|
2006-08-21 03:33:30 +00:00
|
|
|
Benchmark.bm do |x|
|
|
|
|
x.report("haml: ") { RUNS.times { @base.render("templates/standard"); } }
|
|
|
|
x.report("rhtml:") { RUNS.times { @base.render( "rhtml/standard"); } }
|
|
|
|
end
|
|
|
|
|