Skip to content

Commit

Permalink
add scripts useful for profiling
Browse files Browse the repository at this point in the history
Run with 'ruby-prof benchmarks/profile-parser.rb'
  • Loading branch information
minad committed Dec 6, 2011
1 parent 860465a commit ee75659
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions benchmarks/profile-parser.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env ruby

$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'), File.dirname(__FILE__))

require 'slim'

content = File.read(File.dirname(__FILE__) + '/view.slim')
engine = Slim::Engine.new

1000.times { engine.call(content) }
12 changes: 12 additions & 0 deletions benchmarks/profile-render.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env ruby

$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'), File.dirname(__FILE__))

require 'slim'
require 'complex_view'

content = File.read(File.dirname(__FILE__) + '/view.slim')
slim = Slim::Template.new { content }
view = ComplexView.new

10000.times { slim.render(view) }

0 comments on commit ee75659

Please sign in to comment.