Skip to content

Commit

Permalink
Tigthen up benchmark output
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalmoksha committed May 20, 2024
1 parent 277ea1f commit 80eebb3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/benchmark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@

def compare_sanitize
sanitize_config = Sanitize::Config::RELAXED
[[DOCUMENT_HUGE, "huge"], [DOCUMENT_MEDIUM, "medium"], [DOCUMENT_SMALL, "small"]].each do |(html, label)|
Benchmark.ips do |x|
x.report("sanitize-document-#{label}") do
x.report("sanitize-#{label}") do
Sanitize.document(html, sanitize_config)
end

x.report("selma-document-#{label}") do
x.report("selma-#{label}") do
sanitizer = Selma::Sanitizer.new(Selma::Sanitizer::Config::RELAXED)
Selma::Rewriter.new(sanitizer: sanitizer).rewrite(html)
end
Expand Down

0 comments on commit 80eebb3

Please sign in to comment.