summaryrefslogtreecommitdiff
path: root/benchmark/app_erb.yml
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-10 15:58:52 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-10 15:58:52 +0000
commit3efcb74036af32cbcc889d06d8c6c546289e89f4 (patch)
tree8f8ee7b0bddbac0ed4021d2b1af27c05f57391de /benchmark/app_erb.yml
parent498487ec2a49ca99b663ed2bab794c4eebd1c66c (diff)
benchmark: revise ERB benchmarks using YAML syntax
to improve the accuracy of measurement by stop using block. benchmark/app_erb.rb -> benchmark/app_erb.yml: renamed and revised benchmark/erb_render.rb -> benchmark/erb_render.yml: ditto benchmark/README.md: follow renames git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark/app_erb.yml')
-rw-r--r--benchmark/app_erb.yml24
1 files changed, 24 insertions, 0 deletions
diff --git a/benchmark/app_erb.yml b/benchmark/app_erb.yml
new file mode 100644
index 0000000000..8583858d20
--- /dev/null
+++ b/benchmark/app_erb.yml
@@ -0,0 +1,24 @@
+#
+# Create many HTML strings with ERB.
+#
+prelude: |
+ require 'erb'
+
+ data = <<erb
+ <html>
+ <head> <%= title %> </head>
+ <body>
+ <h1> <%= title %> </h1>
+ <p>
+ <%= content %>
+ </p>
+ </body>
+ </html>
+ erb
+
+ max = 15_000
+ title = "hello world!"
+ content = "hello world!\n" * 10
+benchmark:
+ app_erb: ERB.new(data).result(binding)
+loop_count: 15000