[rubygems/rubygems] Use a constant empty tar header to avoid extra allocations
[ruby.git] / benchmark / cgi_escape_html.yml
blob655be9d7d8fde9b1d7ec208b5cfa809dbf89afc9
1 prelude: |
2   # frozen_string_literal: true
3   require 'cgi/escape'
4 benchmark:
5   - script: CGI.escapeHTML("")
6     loop_count: 20000000
7   - script: CGI.escapeHTML("abcde")
8     loop_count: 20000000
9   - script: CGI.escapeHTML("abcd<")
10     loop_count: 20000000
11   - script: CGI.escapeHTML("'&\"<>")
12     loop_count: 5000000
13   - prelude: long_no_escape = "abcde" * 300
14     script: CGI.escapeHTML(long_no_escape)
15     loop_count: 1000000
16   - prelude: long_all_escape = "'&\"<>" * 10
17     script: CGI.escapeHTML(long_all_escape)
18     loop_count: 1000000
19   - prelude: | # http://example.com/
20       example_html = <<~HTML
21         <body>
22         <div>
23             <h1>Example Domain</h1>
24             <p>This domain is established to be used for illustrative examples in documents. You may use this
25             domain in examples without prior coordination or asking for permission.</p>
26             <p><a href="http://www.iana.org/domains/example">More information...</a></p>
27         </div>
28         </body>
29       HTML
30     script: CGI.escapeHTML(example_html)
31     loop_count: 1000000