Skip to content
This repository has been archived by the owner on Aug 25, 2020. It is now read-only.

Commit

Permalink
specs to make sure XML transformation is correct. cleaning up code.
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Apr 1, 2011
1 parent da988bc commit d95cbc0
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 2,296 deletions.
29 changes: 29 additions & 0 deletions benchmark.rb
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
Loading

0 comments on commit d95cbc0

Please sign in to comment.