Sha256: a78e6b44b8a49d55a5d47e26c5fe59a6e92f2ded56e647faf7abd4558b486324

Contents?: true

Size: 840 Bytes

Versions: 29

Compression:

Stored size: 840 Bytes

Contents

require 'rubygems'
require File.dirname(__FILE__) + '/../../lib/feedzirra.rb'

require 'open-uri'

require 'benchmark'
include Benchmark

iterations = 10
urls = File.readlines(File.dirname(__FILE__) + "/../sample_feeds/successful_feed_urls.txt").slice(0, 20)
puts "benchmarks on #{urls.size} feeds"
puts "************************************"
benchmark do |t|    
  t.report("feedzirra open uri") do
    iterations.times do
      urls.each do |url|
        Feedzirra::Feed.parse(open(url, "User-Agent" => "feedzirra http://github.com/pauldix/feedzirra/tree/master").read)
        $stdout.print '.'; $stdout.flush
      end
    end
  end

  t.report("feedzirra fetch and parse") do
    iterations.times do
      Feedzirra::Feed.fetch_and_parse(urls, :on_success => lambda { |url, feed| $stdout.print '.'; $stdout.flush })
    end
  end  
end

Version data entries

29 entries across 29 versions & 10 rubygems

Version Path
Spectives-feedzirra-0.0.28 spec/benchmarks/fetching_benchmarks.rb
Spectives-feedzirra-0.0.29 spec/benchmarks/fetching_benchmarks.rb
Spectives-feedzirra-0.0.31 spec/benchmarks/fetching_benchmarks.rb
Spectives-logophobia-feedzirra-0.0.31 spec/benchmarks/fetching_benchmarks.rb
logophobia-feedzirra-0.0.20 spec/benchmarks/fetching_benchmarks.rb
logophobia-feedzirra-0.0.21 spec/benchmarks/fetching_benchmarks.rb
logophobia-feedzirra-0.0.22 spec/benchmarks/fetching_benchmarks.rb
logophobia-feedzirra-0.0.27 spec/benchmarks/fetching_benchmarks.rb
logophobia-feedzirra-0.0.28 spec/benchmarks/fetching_benchmarks.rb
logophobia-feedzirra-0.0.31 spec/benchmarks/fetching_benchmarks.rb
logophobia-logophobia-feedzirra-0.0.31 spec/benchmarks/fetching_benchmarks.rb
rubylibre-feedzirra-0.0.23 spec/benchmarks/fetching_benchmarks.rb
rubylibre-feedzirra-0.0.24 spec/benchmarks/fetching_benchmarks.rb
rubylibre-feedzirra-0.0.25 spec/benchmarks/fetching_benchmarks.rb
rubylibre-feedzirra-0.0.26 spec/benchmarks/fetching_benchmarks.rb
feedzirra-0.2.1 spec/benchmarks/fetching_benchmarks.rb
codders-feedzirra-0.2.0.rc2 spec/benchmarks/fetching_benchmarks.rb
feedzirra-0.2.0.rc2 spec/benchmarks/fetching_benchmarks.rb
feedzirra-0.2.0.rc1 spec/benchmarks/fetching_benchmarks.rb
jashmenn-feedzirra-0.1.3 spec/benchmarks/fetching_benchmarks.rb