Skip to content

Commit

Permalink
Reduced benchmark iterations because pr-zlib was too slow.
Browse files Browse the repository at this point in the history
  • Loading branch information
djberg96 committed May 10, 2012
1 parent 7bcb80d commit c3e4927
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions profile/bench_pr_zlib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
GZ_FILE_NAME = "benchmark.txt.gz"

File.open(FILE_NAME, "w") do |fh|
100000.times{ |x|
10000.times{ |x|
s = "Now is the time for #{x} good men to come to the aid of their country."
fh.puts s
}
end

Benchmark.bm do |x|
x.report("write") do
50.times{
5.times{
Zlib::GzipWriter.open(GZ_FILE_NAME) do |gz|
gz.write(File.read(FILE_NAME))
end
}
end

x.report("read") do
100.times{
5.times{
Zlib::GzipReader.open(GZ_FILE_NAME) do |gz|
gz.read
end
Expand Down
6 changes: 3 additions & 3 deletions profile/bench_zlib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
GZ_FILE_NAME = "benchmark.txt.gz"

File.open(FILE_NAME, "w") do |fh|
100000.times{ |x|
10000.times{ |x|
s = "Now is the time for #{x} good men to come to the aid of their country."
fh.puts s
}
end

Benchmark.bm do |x|
x.report("write") do
50.times{
5.times{
Zlib::GzipWriter.open(GZ_FILE_NAME) do |gz|
gz.write(File.read(FILE_NAME))
end
}
end

x.report("read") do
100.times{
5.times{
Zlib::GzipReader.open(GZ_FILE_NAME) do |gz|
gz.read
end
Expand Down

0 comments on commit c3e4927

Please sign in to comment.