diff options
author | murphy <murphy@rubychan.de> | 2010-09-21 13:56:46 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2010-09-21 13:56:46 +0000 |
commit | 74e1cdcdfe02cee4dc2caa596855d63b5b6c0d5d (patch) | |
tree | 82e4a73ea8b403e6dcdf974f8647ab22209ecde4 | |
parent | cc28e6b7af0890f59ddb1df98b2f15decebd791e (diff) | |
download | coderay-74e1cdcdfe02cee4dc2caa596855d63b5b6c0d5d.tar.gz |
Benchmark doesn't bench IO any more.
-rw-r--r-- | bench/bench.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/bench/bench.rb b/bench/bench.rb index 959cbe5..f73b1c9 100644 --- a/bench/bench.rb +++ b/bench/bench.rb @@ -78,14 +78,14 @@ Benchmark.bm(20) do |bm| @size = data.size end + options = { + :tab_width => 2, + :wrap => :page, + :line_numbers => :table, + :css => $style ? :style : :class, + } + $hl = CodeRay.encoder(format, options) unless $dump_output time = bm.report('CodeRay') do - options = { - :tab_width => 2, - :wrap => :page, - :line_numbers => :table, - :css => $style ? :style : :class, - } - $hl = CodeRay.encoder(format, options) unless $dump_output N.times do if $stream || true if $dump_input @@ -111,11 +111,11 @@ Benchmark.bm(20) do |bm| end end end - $file_created = here('test.' + - ($dump_output ? 'dump' : $hl.file_extension)) - File.open($file_created, 'wb') do |f| - f.write $o - end + end + $file_created = here('test.' + + ($dump_output ? 'dump' : $hl.file_extension)) + File.open($file_created, 'wb') do |f| + f.write $o end Dir.chdir(here) do FileUtils.copy 'test.dump', 'example.dump' if $dump_output |