Sha256: 1c1045600b5dd19918e931820a3159ef4e5b4ea55321bdcb1831981756ae0cac

Contents?: true

Size: 718 Bytes

Versions: 3

Compression:

Stored size: 718 Bytes

Contents

require File.dirname(__FILE__) + '/../../lib/feedzirra.rb'
require 'rfeedparser'
require 'feed-normalizer'

require 'benchmark'
include Benchmark

iterations = 50
xml = File.read(File.dirname(__FILE__) + '/../sample_feeds/PaulDixExplainsNothing.xml')

benchmark do |t|
  t.report("feedzirra") do
    iterations.times do
      Feedzirra::Feed.parse(xml)
    end
  end

  t.report("rfeedparser") do
    iterations.times do
      FeedParser.parse(xml)
    end
  end

  t.report("feed-normalizer") do
    iterations.times do
      # have to use the :force option to make feed-normalizer parse an atom feed
      FeedNormalizer::FeedNormalizer.parse(xml, :force_parser => FeedNormalizer::SimpleRssParser)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
feedzirra-0.4.0 spec/benchmarks/parsing_benchmark.rb
feedzirra-0.3.0 spec/benchmarks/parsing_benchmark.rb
feedzirra-0.2.2 spec/benchmarks/parsing_benchmark.rb