benchmark/http.rb in yajl-ruby-0.6.3 vs benchmark/http.rb in yajl-ruby-0.6.4
- old
+ new
@@ -2,20 +2,20 @@
require 'rubygems'
require 'benchmark'
require 'yajl/http_stream'
require 'yajl/gzip'
require 'yajl/deflate'
-require 'yajl/bzip2'
+require 'yajl/bzip2' unless defined?(Bzip2)
require 'json'
require 'uri'
require 'net/http'
uri = URI.parse('http://search.twitter.com/search.json?q=github')
# uri = URI.parse('http://localhost/yajl-ruby.git/benchmark/subjects/contacts.json')
times = ARGV[0] ? ARGV[0].to_i : 1
puts "Starting benchmark parsing #{uri.to_s} #{times} times\n\n"
-Benchmark.bm { |x|
+Benchmark.bmbm { |x|
x.report {
puts "Yajl::HttpStream.get"
times.times {
Yajl::HttpStream.get(uri)
}
\ No newline at end of file