adlint-benchmark 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,18 @@
1
+ Thu Nov 29 17:55:06 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
2
+
3
+ * release.ga : 1.1.0
4
+ - Eliminate total time output of AdLint.
5
+ - Add --count NUM option.
6
+
7
+ Thu Nov 29 15:06:35 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
8
+
9
+ * lib/adlint/benchmark/target/screen_4_0_3_process_c.rb : Eliminate
10
+ total time output of AdLint.
11
+ * lib/adlint/benchmark/target/screen_4_0_3_process_c_small.rb : Ditto.
12
+
13
+ * bin/adlint_bm : Add --count NUM option.
14
+ * lib/adlint/benchmark/driver.rb : Ditto.
15
+
1
16
  Tue Nov 27 18:01:39 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
2
17
 
3
18
  * release.ga : 1.0.0
data/NEWS CHANGED
@@ -22,6 +22,13 @@
22
22
 
23
23
  ++
24
24
 
25
+ === 1.1.0 is released (2012-11-29)
26
+
27
+ ==== Changes since the 1.0.0 release
28
+
29
+ * Eliminate total time output of \AdLint
30
+ * Add --count NUM option
31
+
25
32
  === 1.0.0 is released (2012-11-27)
26
33
 
27
34
  This is the initial GA release of adlint-benchmark.
data/Rakefile CHANGED
@@ -53,7 +53,7 @@ gemspec = Gem::Specification.new do |s|
53
53
  s.extra_rdoc_files = %w(README)
54
54
  s.rdoc_options = ["--main", "README", "--charset", "utf-8"]
55
55
 
56
- s.add_dependency("adlint", ">= 2.6.10")
56
+ s.add_dependency("adlint", ">= 2.6.12")
57
57
  end
58
58
 
59
59
  Gem::PackageTask.new(gemspec) do |pkg|
data/bin/adlint_bm CHANGED
@@ -49,7 +49,8 @@ USAGE = <<EOS
49
49
  Usage: adlint_bm [options]
50
50
 
51
51
  Benchmark Options:
52
- -t, --target [NAME] Analysis target name (screen-4.0.3/process.c.small)
52
+ -t NAME, --target NAME Analysis target name (screen-4.0.3/process.c.small)
53
+ -c NUM, --count NUM Repeat NUM times (1)
53
54
  -p, --print-time Display elapsed time
54
55
 
55
56
  Other Options:
@@ -62,6 +63,7 @@ EOS
62
63
  require "getoptlong"
63
64
 
64
65
  parser = GetoptLong.new(["--target", "-t", GetoptLong::REQUIRED_ARGUMENT],
66
+ ["--count", "-c", GetoptLong::REQUIRED_ARGUMENT],
65
67
  ["--print-time", "-p", GetoptLong::NO_ARGUMENT],
66
68
  ["--version", GetoptLong::NO_ARGUMENT],
67
69
  ["--copyright", GetoptLong::NO_ARGUMENT],
@@ -70,11 +72,14 @@ parser = GetoptLong.new(["--target", "-t", GetoptLong::REQUIRED_ARGUMENT],
70
72
 
71
73
  begin
72
74
  target_name = "screen-4.0.3/process.c.small"
75
+ count = 1
73
76
  print_time = false
74
77
  parser.each_option do |optname, optarg|
75
78
  case optname
76
79
  when "--target"
77
80
  target_name = optarg
81
+ when "--count"
82
+ count = optarg.to_i
78
83
  when "--print-time"
79
84
  print_time = true
80
85
  when "--version"
@@ -94,6 +99,6 @@ begin
94
99
  rescue
95
100
  end
96
101
 
97
- AdLint::Benchmark.run(target_name, print_time)
102
+ AdLint::Benchmark.run(target_name, count, print_time)
98
103
 
99
104
  exit 0
@@ -33,14 +33,17 @@
33
33
  module AdLint #:nodoc:
34
34
 
35
35
  module Benchmark
36
- def run(target_name, print_time = false)
36
+ def run(target_name, count, print_time = false)
37
37
  if print_time
38
38
  require "benchmark"
39
- ::Benchmark.bm(target_name.length) do |x|
40
- x.report(target_name) { _run(target_name) }
39
+ ::Benchmark.bm(target_name.length + 5, "total") do |x|
40
+ total = count.times.reduce(::Benchmark::Tms.new) { |t, i|
41
+ t += x.report("#{target_name} ##{i + 1}") { _run(target_name) }
42
+ }
43
+ [total]
41
44
  end
42
45
  else
43
- _run(target_name)
46
+ count.times { _run(target_name) }
44
47
  end
45
48
  end
46
49
  module_function :run
@@ -39,7 +39,7 @@ module Target #:nodoc:
39
39
  class T_screen_4_0_3_process_c < AnalysisTarget
40
40
  private
41
41
  def _analyze
42
- AdLint.setup("adlint_sma", Pathname.new("adlint_traits.yml"), true)
42
+ AdLint.setup("adlint_sma", Pathname.new("adlint_traits.yml"), false)
43
43
  AdLint.sma([Pathname.new("../screen-4.0.3/process.c")], 1)
44
44
  end
45
45
 
@@ -39,7 +39,7 @@ module Target #:nodoc:
39
39
  class T_screen_4_0_3_process_c_small < AnalysisTarget
40
40
  private
41
41
  def _analyze
42
- AdLint.setup("adlint_sma", Pathname.new("adlint_traits.yml"), true)
42
+ AdLint.setup("adlint_sma", Pathname.new("adlint_traits.yml"), false)
43
43
  AdLint.sma([Pathname.new("../screen-4.0.3/process.c")], 1)
44
44
  end
45
45
 
@@ -34,9 +34,9 @@ module AdLint #:nodoc:
34
34
  module Benchmark #:nodoc:
35
35
 
36
36
  MAJOR_VERSION = 1
37
- MINOR_VERSION = 0
37
+ MINOR_VERSION = 1
38
38
  PATCH_VERSION = 0
39
- RELEASE_DATE = "2012-11-27"
39
+ RELEASE_DATE = "2012-11-29"
40
40
 
41
41
  SHORT_VERSION = "#{MAJOR_VERSION}.#{MINOR_VERSION}.#{PATCH_VERSION}"
42
42
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adlint-benchmark
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-27 00:00:00.000000000 Z
12
+ date: 2012-11-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: adlint
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 2.6.10
21
+ version: 2.6.12
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 2.6.10
29
+ version: 2.6.12
30
30
  description: Simple benchmark of AdLint
31
31
  email: yanoh@users.sourceforge.net
32
32
  executables: