diff options
author | murphy <murphy@rubychan.de> | 2007-04-24 12:26:18 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2007-04-24 12:26:18 +0000 |
commit | 3ecc8116cc06289724f9a2ccf734e99d843abc79 (patch) | |
tree | f4f20fe32327d5127a2778b5cd19baea644c3fd8 /bench | |
parent | 47ba0455640b4a6a0ae90961c176c9ea42afa2ea (diff) | |
download | coderay-3ecc8116cc06289724f9a2ccf734e99d843abc79.tar.gz |
Benchmark, comparison: replaced SilverCity with pygments
A bit of code and documentation cleanup
HTML encoder: fixed css class output for NO_HIGHLIGHT tokens when :info is set.
Fixed Text encoder.
Diffstat (limited to 'bench')
-rw-r--r-- | bench/bench.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bench/bench.rb b/bench/bench.rb index 6735b10..19e373d 100644 --- a/bench/bench.rb +++ b/bench/bench.rb @@ -117,7 +117,8 @@ Benchmark.bm(20) do |bm| end end end - $file_created = here('test.' + $hl.file_extension) + $file_created = here('test.' + + ($dump_output ? 'dump' : $hl.file_extension)) File.open($file_created, 'wb') do |f| f.write $o end @@ -154,6 +155,7 @@ Benchmark.bm(20) do |bm| end puts "\t%7.2f KB/sec" % ((@size / 1024.0) / time.real) +=begin time = bm.report('SilverCity') do Dir.chdir(here) do File.open('input-data', 'w') { |f| f.write data } @@ -164,6 +166,19 @@ Benchmark.bm(20) do |bm| $file_created << ", test.silvercity.#{format}" end puts "\t%7.2f KB/sec" % ((@size / 1024.0) / time.real) +=end + time = bm.report('Pygments') do + Dir.chdir(here) do + Dir.chdir File.expand_path('~/Python/pygments') do + File.open('input-data', 'w') { |f| f.write data } + N.times do + `python pygmentize -l#{lang} -fhtml input-data > /dev/null` + end + end + end + #$file_created << ", test.silvercity.#{format}" + end + puts "\t%7.2f KB/sec" % ((@size / 1024.0) / time.real) end end |