Sha256: 87089c3bbcb36493e2ad84d8e8d52cdb02f2870dc420863aaaff94e73fa90b59
Contents?: true
Size: 772 Bytes
Versions: 1
Compression:
Stored size: 772 Bytes
Contents
require 'rubygems' require 'alf' require File.expand_path('../mar_reader', __FILE__) require File.expand_path('../gz_reader', __FILE__) require 'benchmark' def which_ruby if Object.const_defined?(:RUBY_DESCRIPTION) RUBY_DESCRIPTION =~ /^([^\s]+\s*[^\s]+)/ $1 else "ruby #{RUBY_VERSION} (#{RUBY_PLATFORM})" end end log = Alf::Environment.folder('.').dataset("hitradio.log") rash = Alf::Environment.folder('.').dataset("hitradio.rash") mar = Alf::Environment.folder('.').dataset("hitradio.mar") gz = Alf::Environment.folder('.').dataset("hitradio.mar.gz") puts which_ruby Benchmark.bm do |bench| bench.report('.log'){ log.each{} } bench.report('.rash'){ rash.each{} } bench.report('.mar'){ mar.each{} } bench.report('.gz'){ gz.each{} } end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
alf-0.10.1 | examples/hitradio/compare1.rb |