railsbench 0.9.2 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/CHANGELOG +1808 -451
  2. data/GCPATCH +73 -0
  3. data/INSTALL +5 -0
  4. data/Manifest.txt +23 -13
  5. data/PROBLEMS +0 -0
  6. data/README +23 -7
  7. data/Rakefile +1 -2
  8. data/bin/railsbench +7 -1
  9. data/config/benchmarking.rb +0 -0
  10. data/config/benchmarks.rb +3 -2
  11. data/config/benchmarks.yml +0 -0
  12. data/images/empty.png +0 -0
  13. data/images/minus.png +0 -0
  14. data/images/plus.png +0 -0
  15. data/install.rb +1 -1
  16. data/latest_changes.txt +18 -0
  17. data/lib/benchmark.rb +0 -0
  18. data/lib/railsbench/benchmark.rb +576 -0
  19. data/lib/railsbench/benchmark_specs.rb +63 -63
  20. data/lib/railsbench/gc_info.rb +38 -3
  21. data/lib/railsbench/perf_info.rb +1 -1
  22. data/lib/railsbench/perf_utils.rb +202 -179
  23. data/lib/railsbench/railsbenchmark.rb +213 -55
  24. data/lib/railsbench/version.rb +9 -9
  25. data/lib/railsbench/write_headers_only.rb +15 -15
  26. data/postinstall.rb +0 -0
  27. data/ruby185gc.patch +56 -29
  28. data/ruby186gc.patch +564 -0
  29. data/ruby19gc.patch +2425 -0
  30. data/script/convert_raw_data_files +49 -49
  31. data/script/generate_benchmarks +14 -4
  32. data/script/perf_bench +12 -8
  33. data/script/perf_comp +1 -1
  34. data/script/perf_comp_gc +9 -1
  35. data/script/perf_diff +2 -2
  36. data/script/perf_diff_gc +2 -2
  37. data/script/perf_html +1 -1
  38. data/script/perf_plot +192 -75
  39. data/script/perf_plot_gc +213 -74
  40. data/script/perf_prof +29 -10
  41. data/script/perf_run +2 -2
  42. data/script/perf_run_gc +2 -2
  43. data/script/perf_table +2 -2
  44. data/script/perf_tex +1 -1
  45. data/script/perf_times +6 -6
  46. data/script/perf_times_gc +14 -2
  47. data/script/run_urls +16 -10
  48. data/setup.rb +0 -0
  49. data/test/railsbench_test.rb +0 -0
  50. data/test/test_helper.rb +2 -0
  51. metadata +77 -55
data/script/perf_times CHANGED
@@ -22,24 +22,24 @@ files.each do |file|
22
22
  printf " requests=#{iter}, options=#{options}\n\n"
23
23
  k = 'loading environment'
24
24
  printf "%-32s %9.5f\n\n", k, pi.load_time_mean
25
- printf "%-32s %9s %7s %6s %6s\n", 'page request', 'total', 'stddev%', 'r/s', 'ms/r'
25
+ printf "%-32s %9s %7s %7s %7s\n", 'page request', 'total', 'stddev%', 'r/s', 'ms/r'
26
26
 
27
27
  pi.keys.each do |k|
28
28
  t = pi.timings_mean(k)
29
29
  devp = pi.timings_stddev_percentage(k)
30
30
  urls = pi.requests_per_key
31
- printf "%-32s %9.5f %7.4f %6.2f %6.2f\n",
31
+ printf "%-32s %9.5f %7.4f %7.2f %7.2f\n",
32
32
  truncate(k), t, devp, (iter*urls)/t, t*1000/(iter*urls)
33
33
  end
34
34
 
35
- printf "\n%-32s %9.5f %7.4f %6.2f %6.2f\n",
35
+ printf "\n%-32s %9.5f %7.4f %7.2f %7.2f\n",
36
36
  "all requests", pi.total_time_mean, pi.total_time_stddev_percentage,
37
37
  pi.request_count/pi.total_time_mean, pi.total_time_mean*1000/pi.request_count
38
38
 
39
39
  if pi.gc_stats?
40
- printf "\n%-32s %9s %7s %6s %6s\n",
40
+ printf "\n%-32s %9s %7s %7s %7s\n",
41
41
  "garbage collection statistics", "time", "stddev%", "count", "total%"
42
- printf "%-32s %9.5f %7.4f %6.2f %6.2f\n",
42
+ printf "%-32s %9.5f %7.4f %7.2f %7.2f\n",
43
43
  "", pi.gc_time_mean, pi.gc_time_stddev_percentage, pi.gc_calls_mean, (pi.gc_time_mean/pi.total_time_mean)*100
44
44
  end
45
45
 
@@ -49,7 +49,7 @@ end
49
49
 
50
50
  __END__
51
51
 
52
- # Copyright (C) 2005, 2006, 2007 Stefan Kaes
52
+ # Copyright (C) 2005-2008 Stefan Kaes
53
53
  #
54
54
  # This program is free software; you can redistribute it and/or modify
55
55
  # it under the terms of the GNU General Public License as published by
data/script/perf_times_gc CHANGED
@@ -57,7 +57,19 @@ files.each_with_index do |file, idx|
57
57
  gci.freelist_mean, gci.freelist_stddev_percentage, gci.freelist_min, gci.freelist_max
58
58
 
59
59
  printf "\nheap topology:\n"
60
- gci.topology.each_with_index{|size, idx| printf " HEAP[%d] = %7d\n", idx, size }
60
+ printf "%9s %6s\n", "slot_size", "#heaps"
61
+ heaps_count = {}
62
+ gci.topology.each{|size| heaps_count[size] = (heaps_count[size] || 0) + 1}
63
+ heaps_count.keys.sort.each do |size|
64
+ printf "%9d %6d\n", size, heaps_count[size]
65
+ end
66
+
67
+ if gci.mallocs > 0
68
+ printf "\nleak anlysis:\n"
69
+ printf "mallocs/bytes : %10d / %10d\n", gci.mallocs, gci.malloced
70
+ printf "leaks/bytes : %10d / %10d\n", gci.leaks, gci.leaked
71
+ printf "leaked/request: %10.2f bytes\n", gci.leaked.to_f/gci.num_requests
72
+ end
61
73
 
62
74
  file.close
63
75
 
@@ -65,7 +77,7 @@ end
65
77
 
66
78
  __END__
67
79
 
68
- # Copyright (C) 2005, 2006, 2007 Stefan Kaes
80
+ # Copyright (C) 2005-2008 Stefan Kaes
69
81
  #
70
82
  # This program is free software; you can redistribute it and/or modify
71
83
  # it under the terms of the GNU General Public License as published by
data/script/run_urls CHANGED
@@ -1,24 +1,29 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- unless ENV['RAILS_ROOT']
4
- $stderr.puts("\nrun_urls: can't run urls unless RAILS_ROOT is set")
5
- $stderr.puts("\nbenchmarking aborted!")
6
- exit 1
7
- end
8
-
9
3
  if ARGV.length == 0 || ARGV.first == 'help'
10
4
  $stderr.puts "usage: run_urls iterations option_1 ... option_n"
11
5
  $stderr.puts "example: run_urls 100 -bm=default -log | grep Status:"
12
6
  exit 1
13
7
  end
14
8
 
9
+ unless ENV['RAILS_ROOT']
10
+ if File.directory?("config") && File.exists?("config/environment.rb")
11
+ ENV['RAILS_ROOT'] = File.expand_path(".")
12
+ else
13
+ $stderr.puts("#{File.basename $PROGRAM_NAME}: $RAILS_ROOT not set and could not be configured automatically")
14
+ exit 1
15
+ end
16
+ end
17
+
15
18
  $:.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
16
19
  require 'railsbench/railsbenchmark'
17
20
  require ENV['RAILS_ROOT'] + '/config/benchmarks'
18
21
 
19
22
  trap("INT") do
20
- $stderr.puts "clearing database connections ..."
21
- ActiveRecord::Base.send :clear_all_cached_connections!
23
+ $stderr.print "clearing database connections ..."
24
+ ActiveRecord::Base.send :clear_all_cached_connections! if ActiveRecord::Base.respond_to?(:clear_all_cached_connections)
25
+ ActiveRecord::Base.send :clear_all_connections! if ActiveRecord::Base.respond_to?(:clear_all_connections)
26
+ $stderr.puts
22
27
  $stderr.puts "benchmarking aborted!"
23
28
  exit!(-1)
24
29
  end
@@ -30,11 +35,12 @@ RAILS_BENCHMARKER.iterations = ARGV[0].to_i
30
35
  RAILS_BENCHMARKER.setup_test_urls(benchmark_name)
31
36
  RAILS_BENCHMARKER.establish_test_session
32
37
  RAILS_BENCHMARKER.warmup if ARGV.include?('-warmup')
33
- RAILS_BENCHMARKER.run_urls_without_benchmark(ENV['RUBY_GC_STATS'].to_i == 1)
38
+ RAILS_BENCHMARKER.run_urls_without_benchmark(ENV['RUBY_GC_STATS'].to_i == 1 ||
39
+ (GC.respond_to?(:trace_enabled?) && GC.trace_enabled?))
34
40
 
35
41
  __END__
36
42
 
37
- # Copyright (C) 2005, 2006, 2007 Stefan Kaes
43
+ # Copyright (C) 2005-2008 Stefan Kaes
38
44
  #
39
45
  # This program is free software; you can redistribute it and/or modify
40
46
  # it under the terms of the GNU General Public License as published by
data/setup.rb CHANGED
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ require 'test/unit'
2
+
metadata CHANGED
@@ -1,58 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.0
3
- specification_version: 1
4
2
  name: railsbench
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.9.2
7
- date: 2007-04-01 00:00:00 +02:00
8
- summary: rails benchmarking tools
9
- require_paths:
10
- - lib
11
- email: skaes@gmx.net
12
- homepage: http://railsbench.rubyforge.org
13
- rubyforge_project: railsbench
14
- description: rails benchmarking tools
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: false
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.9.8
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Stefan Kaes
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-12-29 00:00:00 +01:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hoe
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.4.0
24
+ version:
25
+ description: rails benchmarking tools
26
+ email: skaes@railsexpress.de
27
+ executables:
28
+ - railsbench
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - Manifest.txt
33
+ - latest_changes.txt
31
34
  files:
32
35
  - BUGS
33
36
  - CHANGELOG
37
+ - GCPATCH
34
38
  - INSTALL
35
- - install.rb
36
- - postinstall.rb
37
39
  - LICENSE
38
40
  - Manifest.txt
39
41
  - PROBLEMS
40
42
  - README
41
43
  - Rakefile
42
- - setup.rb
43
- - ruby184gc.patch
44
- - ruby185gc.patch
45
44
  - bin/railsbench
46
- - lib/railsbench/version.rb
45
+ - config/benchmarking.rb
46
+ - config/benchmarks.rb
47
+ - config/benchmarks.yml
48
+ - images/empty.png
49
+ - images/minus.png
50
+ - images/plus.png
51
+ - install.rb
52
+ - latest_changes.txt
53
+ - lib/benchmark.rb
54
+ - lib/railsbench/benchmark.rb
55
+ - lib/railsbench/benchmark_specs.rb
47
56
  - lib/railsbench/gc_info.rb
48
57
  - lib/railsbench/perf_info.rb
49
58
  - lib/railsbench/perf_utils.rb
50
- - lib/railsbench/write_headers_only.rb
51
59
  - lib/railsbench/railsbenchmark.rb
52
- - lib/railsbench/benchmark_specs.rb
53
- - lib/benchmark.rb
54
- - script/generate_benchmarks
60
+ - lib/railsbench/version.rb
61
+ - lib/railsbench/write_headers_only.rb
62
+ - postinstall.rb
63
+ - ruby184gc.patch
64
+ - ruby185gc.patch
65
+ - ruby186gc.patch
66
+ - ruby19gc.patch
55
67
  - script/convert_raw_data_files
68
+ - script/generate_benchmarks
56
69
  - script/perf_bench
57
70
  - script/perf_comp
58
71
  - script/perf_comp_gc
@@ -69,28 +82,37 @@ files:
69
82
  - script/perf_times
70
83
  - script/perf_times_gc
71
84
  - script/run_urls
72
- - config/benchmarking.rb
73
- - config/benchmarks.rb
74
- - config/benchmarks.yml
75
- test_files:
85
+ - setup.rb
76
86
  - test/railsbench_test.rb
77
- rdoc_options: []
78
-
79
- extra_rdoc_files: []
80
-
81
- executables:
82
- - railsbench
83
- extensions: []
87
+ - test/test_helper.rb
88
+ has_rdoc: true
89
+ homepage: http://railsbench.rubyforge.org
90
+ licenses: []
84
91
 
92
+ post_install_message:
93
+ rdoc_options:
94
+ - --main
95
+ - README.txt
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: "0"
103
+ version:
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: "0"
109
+ version:
85
110
  requirements: []
86
111
 
87
- dependencies:
88
- - !ruby/object:Gem::Dependency
89
- name: hoe
90
- version_requirement:
91
- version_requirements: !ruby/object:Gem::Version::Requirement
92
- requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- version: 1.2.0
96
- version:
112
+ rubyforge_project: railsbench
113
+ rubygems_version: 1.3.5
114
+ signing_key:
115
+ specification_version: 3
116
+ summary: rails benchmarking tools
117
+ test_files:
118
+ - test/railsbench_test.rb