diff options
author | scott Chacon <schacon@agadorsparticus.(none)> | 2007-11-17 08:22:49 -0800 |
---|---|---|
committer | scott Chacon <schacon@agadorsparticus.(none)> | 2007-11-17 08:22:49 -0800 |
commit | b0d47b3112b00cb6c1ae72d6d8a43e583af117ea (patch) | |
tree | 5d8094a62450a88ccc542a7a19e724004fdb8ca8 /benchmark.rb | |
parent | ba0f3cc565d051e79db634dbff1f1d4c71291461 (diff) | |
download | third_party-ruby-git-b0d47b3112b00cb6c1ae72d6d8a43e583af117ea.tar.gz third_party-ruby-git-b0d47b3112b00cb6c1ae72d6d8a43e583af117ea.tar.xz third_party-ruby-git-b0d47b3112b00cb6c1ae72d6d8a43e583af117ea.zip |
significantly improved log performance
Diffstat (limited to 'benchmark.rb')
-rw-r--r-- | benchmark.rb | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/benchmark.rb b/benchmark.rb index 85ddd01..7fc0b5d 100644 --- a/benchmark.rb +++ b/benchmark.rb @@ -1,9 +1,9 @@ require 'fileutils' require 'benchmark' require 'rubygems' -#require 'ruby-prof' -#require_gem 'git', '1.0.2' -require 'lib/git' +require 'ruby-prof' +require_gem 'git', '1.0.3' +#require 'lib/git' def main @wbare = File.expand_path(File.join('tests', 'files', 'working.git')) @@ -12,8 +12,9 @@ def main g = Git.clone(@wbare, 'test') g.chdir do - n = 30 - #result = RubyProf.profile do + n = 40 + result = RubyProf.profile do + puts "<pre>" Benchmark.bm(8) do |x| run_code(x, 'objects') do @@ -94,22 +95,27 @@ def main g.write_tree end end - end + end rescue nil x.report('archive ') do n.times do f = g.gcommit('v2.6').archive # returns path to temp file end end rescue nil - + + end - #end + end # Print a graph profile to text - #printer = RubyProf::FlatPrinter.new(result) - #printer.print(STDOUT, 0) - + puts "</pre>" + printer = RubyProf::GraphHtmlPrinter.new(result) + printer.print(STDOUT, 1) + printer = RubyProf::FlatPrinter.new(result) + puts "<pre>" + printer.print(STDOUT, 1) + puts "</pre>" end end end @@ -148,4 +154,4 @@ def in_temp_dir(remove_after = true) FileUtils.rm_r(tmp_path) if remove_after end -main()
\ No newline at end of file +main() |