This repository has been archived by the owner on Aug 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
specs to make sure XML transformation is correct. cleaning up code.
- Loading branch information
1 parent
da988bc
commit d95cbc0
Showing
6 changed files
with
130 additions
and
2,296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#! /usr/bin/env ruby | ||
|
||
require 'rubygems' | ||
require 'json/ext' | ||
require 'nokogiri' | ||
require 'benchmark' | ||
require 'pp' | ||
|
||
require "lib/fairy_wing_throwdown" | ||
require 'lib/flavorjones' | ||
|
||
json = FairyWingThrowdown.json_string | ||
canonical_ruby = FairyWingThrowdown.canonical_ruby | ||
|
||
puts "benchmarking ..." | ||
xml = Flavorjones.xml_string | ||
n = 1_000 | ||
|
||
Benchmark.bmbm(20) do |benchmark| | ||
benchmark.report("json") do | ||
n.times { JSON.parse json } | ||
end | ||
# benchmark.report("xml (activesupport)") do | ||
# n.times { Flavorjones::XML.new(xml).transform_via_active_support } | ||
# end | ||
benchmark.report("xml (noko-dom)") do | ||
n.times { Flavorjones::XML.new(xml).transform_via_dom } | ||
end | ||
end |
Oops, something went wrong.