Skip to content

Commit

Permalink
looks like Psych::JSON::Stream isn't in 1.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmario committed Feb 21, 2011
1 parent edf3dba commit 4fbb823
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions benchmark/encode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@
Psych.to_json(hash)
}
}
x.report("Psych::JSON::Stream") {
times.times {
io = StringIO.new
stream = Psych::JSON::Stream.new io
stream.start
stream.push hash
stream.finish
if defined?(Psych::JSON::Stream)
x.report("Psych::JSON::Stream") {
times.times {
io = StringIO.new
stream = Psych::JSON::Stream.new io
stream.start
stream.push hash
stream.finish
}
}
}
end
end
if defined?(ActiveSupport::JSON)
x.report("ActiveSupport::JSON.encode") {
Expand Down

0 comments on commit 4fbb823

Please sign in to comment.