hamlit 2.9.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/.travis.yml +45 -0
- data/CHANGELOG.md +666 -0
- data/Gemfile +28 -0
- data/LICENSE.txt +44 -0
- data/README.md +146 -0
- data/REFERENCE.md +266 -0
- data/Rakefile +117 -0
- data/benchmark/boolean_attribute.haml +6 -0
- data/benchmark/class_attribute.haml +5 -0
- data/benchmark/common_attribute.haml +3 -0
- data/benchmark/data_attribute.haml +4 -0
- data/benchmark/dynamic_attributes/boolean_attribute.haml +4 -0
- data/benchmark/dynamic_attributes/class_attribute.haml +4 -0
- data/benchmark/dynamic_attributes/common_attribute.haml +2 -0
- data/benchmark/dynamic_attributes/data_attribute.haml +2 -0
- data/benchmark/dynamic_attributes/id_attribute.haml +2 -0
- data/benchmark/dynamic_boolean_attribute.haml +4 -0
- data/benchmark/etc/attribute_builder.haml +5 -0
- data/benchmark/etc/real_sample.haml +888 -0
- data/benchmark/etc/real_sample.rb +11 -0
- data/benchmark/etc/static_analyzer.haml +1 -0
- data/benchmark/etc/string_interpolation.haml +2 -0
- data/benchmark/etc/tags.haml +3 -0
- data/benchmark/etc/tags_loop.haml +2 -0
- data/benchmark/ext/build_data.rb +17 -0
- data/benchmark/ext/build_id.rb +13 -0
- data/benchmark/id_attribute.haml +3 -0
- data/benchmark/plain.haml +4 -0
- data/benchmark/script.haml +4 -0
- data/benchmark/slim/LICENSE +21 -0
- data/benchmark/slim/context.rb +11 -0
- data/benchmark/slim/run-benchmarks.rb +94 -0
- data/benchmark/slim/view.erb +23 -0
- data/benchmark/slim/view.haml +18 -0
- data/benchmark/slim/view.slim +17 -0
- data/benchmark/utils/benchmark_ips_extension.rb +43 -0
- data/bin/bench +77 -0
- data/bin/console +11 -0
- data/bin/ruby +3 -0
- data/bin/setup +7 -0
- data/bin/stackprof +27 -0
- data/bin/test +24 -0
- data/exe/hamlit +6 -0
- data/ext/hamlit/extconf.rb +10 -0
- data/ext/hamlit/hamlit.c +553 -0
- data/ext/hamlit/hescape.c +108 -0
- data/ext/hamlit/hescape.h +20 -0
- data/hamlit.gemspec +45 -0
- data/lib/hamlit.rb +11 -0
- data/lib/hamlit/attribute_builder.rb +173 -0
- data/lib/hamlit/attribute_compiler.rb +123 -0
- data/lib/hamlit/attribute_parser.rb +110 -0
- data/lib/hamlit/cli.rb +130 -0
- data/lib/hamlit/compiler.rb +97 -0
- data/lib/hamlit/compiler/children_compiler.rb +112 -0
- data/lib/hamlit/compiler/comment_compiler.rb +36 -0
- data/lib/hamlit/compiler/doctype_compiler.rb +46 -0
- data/lib/hamlit/compiler/script_compiler.rb +101 -0
- data/lib/hamlit/compiler/silent_script_compiler.rb +24 -0
- data/lib/hamlit/compiler/tag_compiler.rb +74 -0
- data/lib/hamlit/engine.rb +37 -0
- data/lib/hamlit/error.rb +15 -0
- data/lib/hamlit/escapable.rb +13 -0
- data/lib/hamlit/filters.rb +75 -0
- data/lib/hamlit/filters/base.rb +12 -0
- data/lib/hamlit/filters/cdata.rb +20 -0
- data/lib/hamlit/filters/coffee.rb +17 -0
- data/lib/hamlit/filters/css.rb +33 -0
- data/lib/hamlit/filters/erb.rb +10 -0
- data/lib/hamlit/filters/escaped.rb +22 -0
- data/lib/hamlit/filters/javascript.rb +33 -0
- data/lib/hamlit/filters/less.rb +20 -0
- data/lib/hamlit/filters/markdown.rb +10 -0
- data/lib/hamlit/filters/plain.rb +29 -0
- data/lib/hamlit/filters/preserve.rb +22 -0
- data/lib/hamlit/filters/ruby.rb +10 -0
- data/lib/hamlit/filters/sass.rb +15 -0
- data/lib/hamlit/filters/scss.rb +15 -0
- data/lib/hamlit/filters/text_base.rb +25 -0
- data/lib/hamlit/filters/tilt_base.rb +49 -0
- data/lib/hamlit/force_escapable.rb +29 -0
- data/lib/hamlit/helpers.rb +15 -0
- data/lib/hamlit/html.rb +14 -0
- data/lib/hamlit/identity.rb +13 -0
- data/lib/hamlit/object_ref.rb +30 -0
- data/lib/hamlit/parser.rb +49 -0
- data/lib/hamlit/parser/MIT-LICENSE +20 -0
- data/lib/hamlit/parser/README.md +30 -0
- data/lib/hamlit/parser/haml_buffer.rb +348 -0
- data/lib/hamlit/parser/haml_compiler.rb +553 -0
- data/lib/hamlit/parser/haml_error.rb +61 -0
- data/lib/hamlit/parser/haml_helpers.rb +727 -0
- data/lib/hamlit/parser/haml_options.rb +286 -0
- data/lib/hamlit/parser/haml_parser.rb +800 -0
- data/lib/hamlit/parser/haml_util.rb +288 -0
- data/lib/hamlit/parser/haml_xss_mods.rb +109 -0
- data/lib/hamlit/rails_helpers.rb +51 -0
- data/lib/hamlit/rails_template.rb +58 -0
- data/lib/hamlit/railtie.rb +10 -0
- data/lib/hamlit/ruby_expression.rb +32 -0
- data/lib/hamlit/string_splitter.rb +88 -0
- data/lib/hamlit/template.rb +28 -0
- data/lib/hamlit/utils.rb +18 -0
- data/lib/hamlit/version.rb +4 -0
- metadata +360 -0
@@ -0,0 +1 @@
|
|
1
|
+
#foo.bar{ data: { 'user' => { id: 1234, name: 'k0kubun' }, book_id: 5432 } }
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'hamlit'
|
5
|
+
require 'faml'
|
6
|
+
require 'benchmark/ips'
|
7
|
+
require_relative '../utils/benchmark_ips_extension'
|
8
|
+
|
9
|
+
h = { 'user' => { id: 1234, name: 'k0kubun' }, book_id: 5432 }
|
10
|
+
|
11
|
+
Benchmark.ips do |x|
|
12
|
+
quote = "'"
|
13
|
+
faml_options = { data: h }
|
14
|
+
x.report("Faml::AB.build") { Faml::AttributeBuilder.build(quote, true, nil, faml_options) }
|
15
|
+
x.report("Hamlit.build_data") { Hamlit::AttributeBuilder.build_data(true, quote, h) }
|
16
|
+
x.compare!
|
17
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'hamlit'
|
5
|
+
require 'faml'
|
6
|
+
require 'benchmark/ips'
|
7
|
+
require_relative '../utils/benchmark_ips_extension'
|
8
|
+
|
9
|
+
Benchmark.ips do |x|
|
10
|
+
x.report("Faml::AB.build") { Faml::AttributeBuilder.build("'", true, nil, {:id=>"book"}, id: %w[content active]) }
|
11
|
+
x.report("Hamlit::AB.build_id") { Hamlit::AttributeBuilder.build_id(true, "book", %w[content active]) }
|
12
|
+
x.compare!
|
13
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2010 - 2015 Slim Team
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,94 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
=begin
|
4
|
+
The MIT License
|
5
|
+
|
6
|
+
Copyright (c) 2010 - 2015 Slim Team
|
7
|
+
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
10
|
+
in the Software without restriction, including without limitation the rights
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
13
|
+
furnished to do so, subject to the following conditions:
|
14
|
+
|
15
|
+
The above copyright notice and this permission notice shall be included in
|
16
|
+
all copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
+
THE SOFTWARE.
|
25
|
+
=end
|
26
|
+
|
27
|
+
#
|
28
|
+
# Original: https://github.com/slim-template/slim/blob/v3.0.6/benchmarks/run-benchmarks.rb
|
29
|
+
#
|
30
|
+
# SlimBenchmarks with following modifications:
|
31
|
+
# 1. Skipping slow engines, tilt and parsing benches.
|
32
|
+
# 2. All Ruby script and attributes are escaped for fairness.
|
33
|
+
# 3. Faml and Hamlit are added.
|
34
|
+
#
|
35
|
+
|
36
|
+
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'), File.dirname(__FILE__))
|
37
|
+
|
38
|
+
require 'slim'
|
39
|
+
require 'context'
|
40
|
+
|
41
|
+
require 'benchmark/ips'
|
42
|
+
require 'tilt'
|
43
|
+
require 'erubi'
|
44
|
+
require 'erb'
|
45
|
+
require 'haml'
|
46
|
+
require 'faml'
|
47
|
+
require 'hamlit'
|
48
|
+
|
49
|
+
class SlimBenchmarks
|
50
|
+
def initialize(only_haml)
|
51
|
+
@only_haml = only_haml
|
52
|
+
@benches = []
|
53
|
+
|
54
|
+
@erb_code = File.read(File.dirname(__FILE__) + '/view.erb')
|
55
|
+
@haml_code = File.read(File.dirname(__FILE__) + '/view.haml')
|
56
|
+
@slim_code = File.read(File.dirname(__FILE__) + '/view.slim')
|
57
|
+
|
58
|
+
init_compiled_benches
|
59
|
+
end
|
60
|
+
|
61
|
+
def init_compiled_benches
|
62
|
+
context = Context.new
|
63
|
+
|
64
|
+
haml_ugly = Haml::Engine.new(@haml_code, format: :html5, escape_html: true)
|
65
|
+
haml_ugly.def_method(context, :run_haml_ugly)
|
66
|
+
context.instance_eval %{
|
67
|
+
def run_erubi; #{Erubi::Engine.new(@erb_code).src}; end
|
68
|
+
def run_slim_ugly; #{Slim::Engine.new.call @slim_code}; end
|
69
|
+
def run_faml; #{Faml::Engine.new.call @haml_code}; end
|
70
|
+
def run_hamlit; #{Hamlit::Engine.new.call @haml_code}; end
|
71
|
+
}
|
72
|
+
|
73
|
+
bench("erubi v#{Erubi::VERSION}") { context.run_erubi } unless @only_haml
|
74
|
+
bench("slim v#{Slim::VERSION}") { context.run_slim_ugly } unless @only_haml
|
75
|
+
bench("haml v#{Haml::VERSION}") { context.run_haml_ugly }
|
76
|
+
bench("faml v#{Faml::VERSION}") { context.run_faml }
|
77
|
+
bench("hamlit v#{Hamlit::VERSION}") { context.run_hamlit }
|
78
|
+
end
|
79
|
+
|
80
|
+
def run
|
81
|
+
Benchmark.ips do |x|
|
82
|
+
@benches.each do |name, block|
|
83
|
+
x.report(name.to_s, &block)
|
84
|
+
end
|
85
|
+
x.compare!
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def bench(name, &block)
|
90
|
+
@benches.push([name, block])
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
SlimBenchmarks.new(ENV['ONLY_HAML'] == '1').run
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<!DOCTYPE HTML>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<title>Simple Benchmark</title>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
<h1><%== header %></h1>
|
9
|
+
<% unless item.empty? %>
|
10
|
+
<ul>
|
11
|
+
<% for i in item %>
|
12
|
+
<% if i[:current] %>
|
13
|
+
<li><strong><%== i[:name] %></strong></li>
|
14
|
+
<% else %>
|
15
|
+
<li><a href="<%== i[:url] %>"><%== i[:name] %></a></li>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
</ul>
|
19
|
+
<% else %>
|
20
|
+
<p>The list is empty.</p>
|
21
|
+
<% end %>
|
22
|
+
</body>
|
23
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
!!! html
|
2
|
+
|
3
|
+
%html
|
4
|
+
%head
|
5
|
+
%title Simple Benchmark
|
6
|
+
%body
|
7
|
+
%h1= header
|
8
|
+
- unless item.empty?
|
9
|
+
%ul
|
10
|
+
- for i in item
|
11
|
+
- if i[:current]
|
12
|
+
%li
|
13
|
+
%strong= i[:name]
|
14
|
+
- else
|
15
|
+
%li
|
16
|
+
%a{:href => i[:url]}= i[:name]
|
17
|
+
- else
|
18
|
+
%p The list is empty.
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Monkey patch to show milliseconds
|
2
|
+
module Benchmark
|
3
|
+
module IPS
|
4
|
+
class Report
|
5
|
+
module EntryExtension
|
6
|
+
def body
|
7
|
+
return super if Benchmark::IPS.options[:format] != :human
|
8
|
+
|
9
|
+
left = "%s i/s (%1.3fms)" % [Helpers.scale(ips), (1000.0 / ips)]
|
10
|
+
iters = Helpers.scale(@iterations)
|
11
|
+
|
12
|
+
if @show_total_time
|
13
|
+
left.ljust(20) + (" - %s in %10.6fs" % [iters, runtime])
|
14
|
+
else
|
15
|
+
left.ljust(20) + (" - %s" % iters)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
Entry.prepend(EntryExtension)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
module CompareExtension
|
24
|
+
def compare(*reports)
|
25
|
+
return if reports.size < 2
|
26
|
+
|
27
|
+
sorted = reports.sort_by(&:ips).reverse
|
28
|
+
best = sorted.shift
|
29
|
+
$stdout.puts "\nComparison:"
|
30
|
+
$stdout.printf "%20s: %10.1f i/s (%1.3fms)\n", best.label, best.ips, (1000.0 / best.ips)
|
31
|
+
|
32
|
+
sorted.each do |report|
|
33
|
+
name = report.label.to_s
|
34
|
+
|
35
|
+
x = (best.ips.to_f / report.ips.to_f)
|
36
|
+
$stdout.printf "%20s: %10.1f i/s (%1.3fms) - %.2fx slower\n", name, report.ips, (1000.0 / report.ips), x
|
37
|
+
end
|
38
|
+
|
39
|
+
$stdout.puts
|
40
|
+
end
|
41
|
+
end
|
42
|
+
extend CompareExtension
|
43
|
+
end
|
data/bin/bench
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'hamlit'
|
5
|
+
require 'faml'
|
6
|
+
require 'thor'
|
7
|
+
require 'benchmark/ips'
|
8
|
+
require_relative '../benchmark/utils/benchmark_ips_extension'
|
9
|
+
|
10
|
+
class Bench < Thor
|
11
|
+
class_option :show_template, type: :boolean, aliases: ['-t']
|
12
|
+
|
13
|
+
desc 'bench HAML', 'Benchmark haml template'
|
14
|
+
option :compile, type: :boolean, aliases: ['-c']
|
15
|
+
option :show_code, type: :boolean, aliases: ['-s']
|
16
|
+
def bench(*files)
|
17
|
+
files.each { |file| render(file) }
|
18
|
+
files.each { |file| compile(file) if options[:compile] }
|
19
|
+
files.each { |file| code(file) if options[:show_code] }
|
20
|
+
end
|
21
|
+
|
22
|
+
desc 'compile HAML', 'Benchmark compilation'
|
23
|
+
def compile(file)
|
24
|
+
puts "#{?= * 49}\n Compilation: #{file}\n#{?= * 49}"
|
25
|
+
haml = File.read(file)
|
26
|
+
|
27
|
+
Benchmark.ips do |x|
|
28
|
+
x.report("haml v#{Haml::VERSION}") { Haml::Engine.new(haml, escape_html: true, escape_attrs: true, ugly: true).precompiled }
|
29
|
+
x.report("faml v#{Faml::VERSION}") { Faml::Engine.new.call(haml) }
|
30
|
+
x.report("hamlit v#{Hamlit::VERSION}") { Hamlit::Engine.new.call(haml) }
|
31
|
+
x.compare!
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
desc 'render HAML', 'Benchmark rendering'
|
36
|
+
def render(file)
|
37
|
+
puts "#{?= * 49}\n Rendering: #{file}\n#{?= * 49}"
|
38
|
+
haml = File.read(file)
|
39
|
+
puts haml + "\n" if options[:show_template]
|
40
|
+
object = Object.new
|
41
|
+
ruby_file = file.gsub(/\.haml\z/, '.rb')
|
42
|
+
if File.exist?(ruby_file)
|
43
|
+
object.instance_eval(File.read(ruby_file))
|
44
|
+
end
|
45
|
+
|
46
|
+
Haml::Engine.new(haml, escape_html: true, escape_attrs: true, ugly: true).def_method(object, :haml)
|
47
|
+
object.instance_eval "def faml; #{Faml::Engine.new.call(haml)}; end"
|
48
|
+
object.instance_eval "def hamlit; #{Hamlit::Engine.new.call(haml)}; end"
|
49
|
+
|
50
|
+
Benchmark.ips do |x|
|
51
|
+
x.report("haml v#{Haml::VERSION}") { object.haml }
|
52
|
+
x.report("faml v#{Faml::VERSION}") { object.faml }
|
53
|
+
x.report("hamlit v#{Hamlit::VERSION}") { object.hamlit }
|
54
|
+
x.compare!
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
desc 'code HAML', 'Show compiled code'
|
59
|
+
def code(file)
|
60
|
+
haml = File.read(file)
|
61
|
+
puts "#{?= * 49}\n Haml Source: #{file}\n#{?= * 49}"
|
62
|
+
puts Haml::Engine.new(haml, escape_html: true, escape_attrs: true, ugly: true).precompiled
|
63
|
+
puts "\n#{?= * 49}\n Faml Source: #{file}\n#{?= * 49}"
|
64
|
+
puts Faml::Engine.new.call(haml)
|
65
|
+
puts "\n#{?= * 49}\n Hamlit Source: #{file}\n#{?= * 49}"
|
66
|
+
puts Hamlit::Engine.new.call(haml)
|
67
|
+
end
|
68
|
+
|
69
|
+
private
|
70
|
+
|
71
|
+
def method_missing(*args)
|
72
|
+
return super if args.length > 1
|
73
|
+
render(args.first.to_s)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
Bench.start
|
data/bin/console
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'hamlit'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
require 'pry'
|
11
|
+
Pry.start
|
data/bin/ruby
ADDED
data/bin/setup
ADDED
data/bin/stackprof
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'hamlit'
|
5
|
+
require 'stackprof'
|
6
|
+
|
7
|
+
def open_flamegraph(report)
|
8
|
+
temp = `mktemp /tmp/stackflame-XXXXXXXX`.strip
|
9
|
+
data_path = "#{temp}.js"
|
10
|
+
system("mv #{temp} #{data_path}")
|
11
|
+
|
12
|
+
File.open(data_path, 'w') do |f|
|
13
|
+
report.print_flamegraph(f)
|
14
|
+
end
|
15
|
+
|
16
|
+
viewer_path = File.join(`bundle show stackprof`.strip, 'lib/stackprof/flamegraph/viewer.html')
|
17
|
+
url = "file://#{viewer_path}?data=#{data_path}"
|
18
|
+
system(%Q[osascript -e 'open location "#{url}"'])
|
19
|
+
end
|
20
|
+
|
21
|
+
haml = File.read(ARGV.first)
|
22
|
+
StackProf.start(mode: :wall, interval: 1, raw: false)
|
23
|
+
Hamlit::Engine.new.call(haml)
|
24
|
+
StackProf.stop
|
25
|
+
|
26
|
+
report = StackProf::Report.new(StackProf.results)
|
27
|
+
report.print_text(false)
|