scout 5.6.7 → 5.6.8.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. data/CHANGELOG.markdown +4 -0
  2. data/lib/scout/version.rb +1 -1
  3. data/vendor/json_pure/.gitignore +12 -0
  4. data/vendor/json_pure/.travis.yml +20 -0
  5. data/vendor/json_pure/CHANGES +120 -0
  6. data/vendor/json_pure/COPYING-json-jruby +57 -0
  7. data/vendor/json_pure/Gemfile +11 -0
  8. data/vendor/json_pure/README-json-jruby.markdown +33 -0
  9. data/vendor/json_pure/{README → README.rdoc} +7 -7
  10. data/vendor/json_pure/Rakefile +305 -185
  11. data/vendor/json_pure/VERSION +1 -1
  12. data/vendor/json_pure/diagrams/.keep +0 -0
  13. data/vendor/json_pure/ext/json/ext/fbuffer/fbuffer.h +181 -0
  14. data/vendor/json_pure/ext/json/ext/generator/depend +1 -0
  15. data/vendor/json_pure/ext/json/ext/generator/extconf.rb +4 -6
  16. data/vendor/json_pure/ext/json/ext/generator/generator.c +463 -369
  17. data/vendor/json_pure/ext/json/ext/generator/generator.h +44 -66
  18. data/vendor/json_pure/ext/json/ext/parser/depend +1 -0
  19. data/vendor/json_pure/ext/json/ext/parser/extconf.rb +3 -5
  20. data/vendor/json_pure/ext/json/ext/parser/parser.c +580 -311
  21. data/vendor/json_pure/ext/json/ext/parser/parser.h +14 -8
  22. data/vendor/json_pure/ext/json/ext/parser/parser.rl +242 -107
  23. data/vendor/json_pure/install.rb +8 -11
  24. data/vendor/json_pure/java/src/json/ext/ByteListTranscoder.java +167 -0
  25. data/vendor/json_pure/java/src/json/ext/Generator.java +444 -0
  26. data/vendor/json_pure/java/src/json/ext/GeneratorMethods.java +232 -0
  27. data/vendor/json_pure/java/src/json/ext/GeneratorService.java +43 -0
  28. data/vendor/json_pure/java/src/json/ext/GeneratorState.java +543 -0
  29. data/vendor/json_pure/java/src/json/ext/OptionsReader.java +114 -0
  30. data/vendor/json_pure/java/src/json/ext/Parser.java +2644 -0
  31. data/vendor/json_pure/java/src/json/ext/Parser.rl +968 -0
  32. data/vendor/json_pure/java/src/json/ext/ParserService.java +35 -0
  33. data/vendor/json_pure/java/src/json/ext/RuntimeInfo.java +121 -0
  34. data/vendor/json_pure/java/src/json/ext/StringDecoder.java +167 -0
  35. data/vendor/json_pure/java/src/json/ext/StringEncoder.java +106 -0
  36. data/vendor/json_pure/java/src/json/ext/Utils.java +89 -0
  37. data/vendor/json_pure/json-java.gemspec +23 -0
  38. data/vendor/json_pure/json.gemspec +37 -0
  39. data/vendor/json_pure/json_pure.gemspec +39 -0
  40. data/vendor/json_pure/lib/json.rb +52 -0
  41. data/vendor/json_pure/lib/json/add/bigdecimal.rb +28 -0
  42. data/vendor/json_pure/lib/json/add/complex.rb +22 -0
  43. data/vendor/json_pure/lib/json/add/core.rb +9 -146
  44. data/vendor/json_pure/lib/json/add/date.rb +34 -0
  45. data/vendor/json_pure/lib/json/add/date_time.rb +50 -0
  46. data/vendor/json_pure/lib/json/add/exception.rb +31 -0
  47. data/vendor/json_pure/lib/json/add/ostruct.rb +31 -0
  48. data/vendor/json_pure/lib/json/add/range.rb +29 -0
  49. data/vendor/json_pure/lib/json/add/rational.rb +22 -0
  50. data/vendor/json_pure/lib/json/add/regexp.rb +30 -0
  51. data/vendor/json_pure/lib/json/add/struct.rb +30 -0
  52. data/vendor/json_pure/lib/json/add/symbol.rb +25 -0
  53. data/vendor/json_pure/lib/json/add/time.rb +38 -0
  54. data/vendor/json_pure/lib/json/common.rb +157 -67
  55. data/vendor/json_pure/lib/json/ext.rb +8 -2
  56. data/vendor/json_pure/lib/json/ext/.keep +0 -0
  57. data/vendor/json_pure/lib/json/generic_object.rb +70 -0
  58. data/vendor/json_pure/lib/json/pure.rb +8 -64
  59. data/vendor/json_pure/lib/json/pure/generator.rb +183 -113
  60. data/vendor/json_pure/lib/json/pure/parser.rb +118 -66
  61. data/vendor/json_pure/lib/json/version.rb +1 -1
  62. data/vendor/json_pure/tests/fixtures/fail18.json +1 -1
  63. data/vendor/json_pure/tests/setup_variant.rb +11 -0
  64. data/vendor/json_pure/tests/test_json.rb +233 -28
  65. data/vendor/json_pure/tests/test_json_addition.rb +68 -34
  66. data/vendor/json_pure/tests/test_json_encoding.rb +11 -14
  67. data/vendor/json_pure/tests/test_json_fixtures.rb +11 -10
  68. data/vendor/json_pure/tests/test_json_generate.rb +207 -7
  69. data/vendor/json_pure/tests/test_json_generic_object.rb +75 -0
  70. data/vendor/json_pure/tests/test_json_string_matching.rb +39 -0
  71. data/vendor/json_pure/tests/test_json_unicode.rb +3 -7
  72. data/vendor/json_pure/tools/fuzz.rb +1 -1
  73. data/vendor/json_pure/tools/server.rb +1 -0
  74. metadata +87 -94
  75. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +0 -52
  76. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +0 -1000
  77. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +0 -1001
  78. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +0 -900
  79. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +0 -901
  80. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +0 -1000
  81. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +0 -1001
  82. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +0 -261
  83. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +0 -1000
  84. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +0 -1001
  85. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +0 -1000
  86. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +0 -1001
  87. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +0 -1000
  88. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +0 -1001
  89. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +0 -262
  90. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +0 -1000
  91. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +0 -1001
  92. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +0 -82
  93. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +0 -34
  94. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +0 -900
  95. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +0 -901
  96. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +0 -81
  97. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +0 -1000
  98. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +0 -1001
  99. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +0 -82
  100. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +0 -1000
  101. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +0 -1001
  102. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +0 -82
  103. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +0 -1000
  104. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +0 -1001
  105. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +0 -82
  106. data/vendor/json_pure/benchmarks/generator2_benchmark.rb +0 -222
  107. data/vendor/json_pure/benchmarks/generator_benchmark.rb +0 -224
  108. data/vendor/json_pure/benchmarks/ohai.json +0 -1216
  109. data/vendor/json_pure/benchmarks/ohai.ruby +0 -1
  110. data/vendor/json_pure/benchmarks/parser2_benchmark.rb +0 -251
  111. data/vendor/json_pure/benchmarks/parser_benchmark.rb +0 -259
  112. data/vendor/json_pure/bin/edit_json.rb +0 -9
  113. data/vendor/json_pure/bin/prettify_json.rb +0 -75
  114. data/vendor/json_pure/lib/json/Array.xpm +0 -21
  115. data/vendor/json_pure/lib/json/FalseClass.xpm +0 -21
  116. data/vendor/json_pure/lib/json/Hash.xpm +0 -21
  117. data/vendor/json_pure/lib/json/Key.xpm +0 -73
  118. data/vendor/json_pure/lib/json/NilClass.xpm +0 -21
  119. data/vendor/json_pure/lib/json/Numeric.xpm +0 -28
  120. data/vendor/json_pure/lib/json/String.xpm +0 -96
  121. data/vendor/json_pure/lib/json/TrueClass.xpm +0 -21
  122. data/vendor/json_pure/lib/json/add/rails.rb +0 -58
  123. data/vendor/json_pure/lib/json/editor.rb +0 -1371
  124. data/vendor/json_pure/lib/json/json.xpm +0 -1499
  125. data/vendor/json_pure/tests/test_json_rails.rb +0 -144
@@ -1,82 +0,0 @@
1
- ========================== 2009-04-01T16:46:41 CEST ===========================
2
- Benchmarking on ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux].
3
- Running 'ParserBenchmarkYAML' for 1000 iterations/method (compare_time=real)
4
- ===============================================================================
5
-
6
- This first run is only for warmup.
7
- ParserBenchmarkYAML#parser:
8
- real total user system
9
- sum 4.506546021 4.490000000 4.480000000 0.010000000
10
- min 0.003598928 0.000000000 0.000000000 0.000000000
11
- std- 0.000288588 -0.001817113 -0.001826296 -0.000306228
12
- mean 0.004506546 0.004490000 0.004480000 0.000010000
13
- std+ 0.008724504 0.010797113 0.010786296 0.000326228
14
- max 0.042540073 0.040000000 0.040000000 0.010000000
15
- std 0.004217958 0.006307113 0.006306296 0.000316228
16
- std% 93.596247306 140.470232048 140.765535944 3162.277660168
17
- harm 0.003882332 nan nan nan
18
- geo 0.004019118 0.000000000 0.000000000 0.000000000
19
- q1 0.003660917 0.000000000 0.000000000 0.000000000
20
- med 0.003705978 0.000000000 0.000000000 0.000000000
21
- q3 0.003748715 0.010000000 0.010000000 0.000000000
22
- 1000 221.89943 0.004506546
23
- calls calls/sec secs/call
24
-
25
- 0.04059 -|
26
- 0.03670 -|
27
- 0.03280 -|
28
- 0.02891 -|*
29
- 0.02502 -|
30
- 0.02112 -|
31
- 0.01723 -|
32
- 0.01333 -|
33
- 0.00944 -|
34
- 0.00555 -|**************************************************
35
-
36
- Outliers detected with box plot algo (median=0.00371, iqr=0.00009, factor=3.00):
37
- high=56 very_high=119
38
-
39
- Ljung-Box statistics: q=433.20488 (alpha=0.05, df=50).
40
- 1.00000 >= 0.95000 => Autocorrelation was detected.
41
-
42
- ParserBenchmarkYAML#parser:
43
- real total user system
44
- sum 4.454077959 4.430000000 4.420000000 0.010000000
45
- min 0.003582954 0.000000000 0.000000000 0.000000000
46
- std- 0.000263948 -0.001903657 -0.001912749 -0.000306228
47
- mean 0.004454078 0.004430000 0.004420000 0.000010000
48
- std+ 0.008644208 0.010763657 0.010752749 0.000326228
49
- max 0.035927057 0.040000000 0.040000000 0.010000000
50
- std 0.004190130 0.006333657 0.006332749 0.000316228
51
- std% 94.074019869 142.971948832 143.274853190 3162.277660168
52
- harm 0.003836471 nan nan nan
53
- geo 0.003968258 0.000000000 0.000000000 0.000000000
54
- q1 0.003650367 0.000000000 0.000000000 0.000000000
55
- med 0.003690004 0.000000000 0.000000000 0.000000000
56
- q3 0.003731966 0.010000000 0.010000000 0.000000000
57
- 1000 224.51336 0.004454078
58
- calls calls/sec secs/call
59
-
60
- 0.03431 -|
61
- 0.03108 -|*
62
- 0.02784 -|*
63
- 0.02461 -|
64
- 0.02137 -|
65
- 0.01814 -|
66
- 0.01490 -|
67
- 0.01167 -|
68
- 0.00843 -|
69
- 0.00520 -|**************************************************
70
-
71
- Outliers detected with box plot algo (median=0.00369, iqr=0.00008, factor=3.00):
72
- high=58 very_high=100
73
-
74
- Ljung-Box statistics: q=451.12745 (alpha=0.05, df=50).
75
- 1.00000 >= 0.95000 => Autocorrelation was detected.
76
-
77
- No initial data truncated.
78
- => System may have been in a steady state from the beginning.
79
- ========================== 2009-04-01T16:46:54 CEST ===========================
80
-
81
- Writing measurement data file '/data/scm/json/benchmarks/data/ParserBenchmarkYAML#parser.dat'.
82
- Writing autocorrelation plot file '/data/scm/json/benchmarks/data/ParserBenchmarkYAML#parser-autocorrelation.dat'.
@@ -1,222 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # CODING: UTF-8
3
-
4
- require 'rbconfig'
5
- RUBY_PATH=File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
6
- RAKE_PATH=File.join(Config::CONFIG['bindir'], 'rake')
7
- require 'bullshit'
8
- case ARGV.first
9
- when 'ext'
10
- require 'json/ext'
11
- when 'pure'
12
- require 'json/pure'
13
- when 'rails'
14
- require 'active_support'
15
- when 'yajl'
16
- require 'yajl'
17
- require 'yajl/json_gem'
18
- require 'stringio'
19
- end
20
-
21
- module JSON
22
- def self.[](*) end
23
- end
24
-
25
- module Generator2BenchmarkCommon
26
- include JSON
27
-
28
- def setup
29
- @big = eval File.read(File.join(File.dirname(__FILE__), 'ohai.ruby'))
30
- end
31
-
32
- def generic_reset_method
33
- @result and @result.size >= 16 or raise @result.to_s
34
- end
35
- end
36
-
37
- module JSONGeneratorCommon
38
- include Generator2BenchmarkCommon
39
-
40
- def benchmark_generator_fast
41
- @result = JSON.fast_generate(@big)
42
- end
43
-
44
- alias reset_benchmark_generator_fast generic_reset_method
45
-
46
- def benchmark_generator_safe
47
- @result = JSON.generate(@big)
48
- end
49
-
50
- alias reset_benchmark_generator_safe generic_reset_method
51
-
52
- def benchmark_generator_pretty
53
- @result = JSON.pretty_generate(@big)
54
- end
55
-
56
- alias reset_benchmark_generator_pretty generic_reset_method
57
-
58
- def benchmark_generator_ascii
59
- @result = JSON.generate(@big, :ascii_only => true)
60
- end
61
-
62
- alias reset_benchmark_generator_ascii generic_reset_method
63
- end
64
-
65
- class Generator2BenchmarkExt < Bullshit::RepeatCase
66
- include JSONGeneratorCommon
67
-
68
- warmup yes
69
- iterations 2000
70
-
71
- truncate_data do
72
- enabled false
73
- alpha_level 0.05
74
- window_size 50
75
- slope_angle 0.1
76
- end
77
-
78
- autocorrelation do
79
- alpha_level 0.05
80
- max_lags 50
81
- file yes
82
- end
83
-
84
-
85
- output_dir File.join(File.dirname(__FILE__), 'data')
86
- output_filename benchmark_name + '.log'
87
- data_file yes
88
- histogram yes
89
- end
90
-
91
- class Generator2BenchmarkPure < Bullshit::RepeatCase
92
- include JSONGeneratorCommon
93
-
94
- warmup yes
95
- iterations 400
96
-
97
- truncate_data do
98
- enabled false
99
- alpha_level 0.05
100
- window_size 50
101
- slope_angle 0.1
102
- end
103
-
104
- autocorrelation do
105
- alpha_level 0.05
106
- max_lags 50
107
- file yes
108
- end
109
-
110
- output_dir File.join(File.dirname(__FILE__), 'data')
111
- output_filename benchmark_name + '.log'
112
- data_file yes
113
- histogram yes
114
- end
115
-
116
- class Generator2BenchmarkRails < Bullshit::RepeatCase
117
- include Generator2BenchmarkCommon
118
-
119
- warmup yes
120
- iterations 400
121
-
122
- truncate_data do
123
- enabled false
124
- alpha_level 0.05
125
- window_size 50
126
- slope_angle 0.1
127
- end
128
-
129
- autocorrelation do
130
- alpha_level 0.05
131
- max_lags 50
132
- file yes
133
- end
134
-
135
- output_dir File.join(File.dirname(__FILE__), 'data')
136
- output_filename benchmark_name + '.log'
137
- data_file yes
138
- histogram yes
139
-
140
- def benchmark_generator
141
- @result = @big.to_json
142
- end
143
-
144
- alias reset_benchmark_generator generic_reset_method
145
- end
146
-
147
- class Generator2BenchmarkYajl < Bullshit::RepeatCase
148
- include Generator2BenchmarkCommon
149
-
150
- warmup yes
151
- iterations 2000
152
-
153
- truncate_data do
154
- enabled false
155
- alpha_level 0.05
156
- window_size 50
157
- slope_angle 0.1
158
- end
159
-
160
- autocorrelation do
161
- alpha_level 0.05
162
- max_lags 50
163
- file yes
164
- end
165
-
166
- output_dir File.join(File.dirname(__FILE__), 'data')
167
- output_filename benchmark_name + '.log'
168
- data_file yes
169
- histogram yes
170
-
171
- def benchmark_generator
172
- output = StringIO.new
173
- Yajl::Encoder.new.encode(@big, output)
174
- @result = output.string
175
- end
176
-
177
- def benchmark_generator_gem_api
178
- @result = @big.to_json
179
- end
180
-
181
- def reset_benchmark_generator
182
- generic_reset_method
183
- end
184
- end
185
-
186
- if $0 == __FILE__
187
- Bullshit::Case.autorun false
188
-
189
- case ARGV.first
190
- when 'ext'
191
- Generator2BenchmarkExt.run
192
- when 'pure'
193
- Generator2BenchmarkPure.run
194
- when 'rails'
195
- Generator2BenchmarkRails.run
196
- when 'yajl'
197
- Generator2BenchmarkYajl.run
198
- else
199
- system "#{RAKE_PATH} clean"
200
- system "#{RUBY_PATH} #$0 rails"
201
- system "#{RUBY_PATH} #$0 pure"
202
- system "#{RAKE_PATH} compile_ext"
203
- system "#{RUBY_PATH} #$0 ext"
204
- system "#{RUBY_PATH} #$0 yajl"
205
- Bullshit.compare do
206
- output_filename File.join(File.dirname(__FILE__), 'data', 'Generator2BenchmarkComparison.log')
207
-
208
- benchmark Generator2BenchmarkExt, :generator_fast, :load => yes
209
- benchmark Generator2BenchmarkExt, :generator_safe, :load => yes
210
- benchmark Generator2BenchmarkExt, :generator_pretty, :load => yes
211
- benchmark Generator2BenchmarkExt, :generator_ascii, :load => yes
212
- benchmark Generator2BenchmarkPure, :generator_fast, :load => yes
213
- benchmark Generator2BenchmarkPure, :generator_safe, :load => yes
214
- benchmark Generator2BenchmarkPure, :generator_pretty, :load => yes
215
- benchmark Generator2BenchmarkPure, :generator_ascii, :load => yes
216
- benchmark Generator2BenchmarkRails, :generator, :load => yes
217
- benchmark Generator2BenchmarkYajl, :generator, :load => yes
218
- benchmark Generator2BenchmarkYajl, :generator_gem_api, :load => yes
219
- end
220
- end
221
- end
222
-
@@ -1,224 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # CODING: UTF-8
3
-
4
- require 'rbconfig'
5
- RUBY_PATH=File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
6
- RAKE_PATH=File.join(Config::CONFIG['bindir'], 'rake')
7
- require 'bullshit'
8
- case ARGV.first
9
- when 'ext'
10
- require 'json/ext'
11
- when 'pure'
12
- require 'json/pure'
13
- when 'rails'
14
- require 'active_support'
15
- when 'yajl'
16
- require 'yajl'
17
- require 'yajl/json_gem'
18
- require 'stringio'
19
- end
20
-
21
- module JSON
22
- def self.[](*) end
23
- end
24
-
25
- module GeneratorBenchmarkCommon
26
- include JSON
27
-
28
- def setup
29
- a = [ nil, false, true, "fÖßÄr", [ "n€st€d", true ], { "fooß" => "bär", "quux" => true } ]
30
- puts a.to_json if a.respond_to?(:to_json)
31
- @big = a * 100
32
- end
33
-
34
- def generic_reset_method
35
- @result and @result.size > 2 + 6 * @big.size or raise @result.to_s
36
- end
37
- end
38
-
39
- module JSONGeneratorCommon
40
- include GeneratorBenchmarkCommon
41
-
42
- def benchmark_generator_fast
43
- @result = JSON.fast_generate(@big)
44
- end
45
-
46
- alias reset_benchmark_generator_fast generic_reset_method
47
-
48
- def benchmark_generator_safe
49
- @result = JSON.generate(@big)
50
- end
51
-
52
- alias reset_benchmark_generator_safe generic_reset_method
53
-
54
- def benchmark_generator_pretty
55
- @result = JSON.pretty_generate(@big)
56
- end
57
-
58
- alias reset_benchmark_generator_pretty generic_reset_method
59
-
60
- def benchmark_generator_ascii
61
- @result = JSON.generate(@big, :ascii_only => true)
62
- end
63
-
64
- alias reset_benchmark_generator_ascii generic_reset_method
65
- end
66
-
67
- class GeneratorBenchmarkExt < Bullshit::RepeatCase
68
- include JSONGeneratorCommon
69
-
70
- warmup yes
71
- iterations 2000
72
-
73
- truncate_data do
74
- enabled false
75
- alpha_level 0.05
76
- window_size 50
77
- slope_angle 0.1
78
- end
79
-
80
- autocorrelation do
81
- alpha_level 0.05
82
- max_lags 50
83
- file yes
84
- end
85
-
86
-
87
- output_dir File.join(File.dirname(__FILE__), 'data')
88
- output_filename benchmark_name + '.log'
89
- data_file yes
90
- histogram yes
91
- end
92
-
93
- class GeneratorBenchmarkPure < Bullshit::RepeatCase
94
- include JSONGeneratorCommon
95
-
96
- warmup yes
97
- iterations 400
98
-
99
- truncate_data do
100
- enabled false
101
- alpha_level 0.05
102
- window_size 50
103
- slope_angle 0.1
104
- end
105
-
106
- autocorrelation do
107
- alpha_level 0.05
108
- max_lags 50
109
- file yes
110
- end
111
-
112
- output_dir File.join(File.dirname(__FILE__), 'data')
113
- output_filename benchmark_name + '.log'
114
- data_file yes
115
- histogram yes
116
- end
117
-
118
- class GeneratorBenchmarkRails < Bullshit::RepeatCase
119
- include GeneratorBenchmarkCommon
120
-
121
- warmup yes
122
- iterations 400
123
-
124
- truncate_data do
125
- enabled false
126
- alpha_level 0.05
127
- window_size 50
128
- slope_angle 0.1
129
- end
130
-
131
- autocorrelation do
132
- alpha_level 0.05
133
- max_lags 50
134
- file yes
135
- end
136
-
137
- output_dir File.join(File.dirname(__FILE__), 'data')
138
- output_filename benchmark_name + '.log'
139
- data_file yes
140
- histogram yes
141
-
142
- def benchmark_generator
143
- @result = @big.to_json
144
- end
145
-
146
- alias reset_benchmark_generator generic_reset_method
147
- end
148
-
149
- class GeneratorBenchmarkYajl < Bullshit::RepeatCase
150
- include GeneratorBenchmarkCommon
151
-
152
- warmup yes
153
- iterations 2000
154
-
155
- truncate_data do
156
- enabled false
157
- alpha_level 0.05
158
- window_size 50
159
- slope_angle 0.1
160
- end
161
-
162
- autocorrelation do
163
- alpha_level 0.05
164
- max_lags 50
165
- file yes
166
- end
167
-
168
- output_dir File.join(File.dirname(__FILE__), 'data')
169
- output_filename benchmark_name + '.log'
170
- data_file yes
171
- histogram yes
172
-
173
- def benchmark_generator
174
- output = StringIO.new
175
- Yajl::Encoder.new.encode(@big, output)
176
- @result = output.string
177
- end
178
-
179
- def benchmark_generator_gem_api
180
- @result = @big.to_json
181
- end
182
-
183
- def reset_benchmark_generator
184
- generic_reset_method
185
- end
186
- end
187
-
188
- if $0 == __FILE__
189
- Bullshit::Case.autorun false
190
-
191
- case ARGV.first
192
- when 'ext'
193
- GeneratorBenchmarkExt.run
194
- when 'pure'
195
- GeneratorBenchmarkPure.run
196
- when 'rails'
197
- GeneratorBenchmarkRails.run
198
- when 'yajl'
199
- GeneratorBenchmarkYajl.run
200
- else
201
- system "#{RAKE_PATH} clean"
202
- system "#{RUBY_PATH} #$0 rails"
203
- system "#{RUBY_PATH} #$0 pure"
204
- system "#{RAKE_PATH} compile_ext"
205
- system "#{RUBY_PATH} #$0 ext"
206
- system "#{RUBY_PATH} #$0 yajl"
207
- Bullshit.compare do
208
- output_filename File.join(File.dirname(__FILE__), 'data', 'GeneratorBenchmarkComparison.log')
209
-
210
- benchmark GeneratorBenchmarkExt, :generator_fast, :load => yes
211
- benchmark GeneratorBenchmarkExt, :generator_safe, :load => yes
212
- benchmark GeneratorBenchmarkExt, :generator_pretty, :load => yes
213
- benchmark GeneratorBenchmarkExt, :generator_ascii, :load => yes
214
- benchmark GeneratorBenchmarkPure, :generator_fast, :load => yes
215
- benchmark GeneratorBenchmarkPure, :generator_safe, :load => yes
216
- benchmark GeneratorBenchmarkPure, :generator_pretty, :load => yes
217
- benchmark GeneratorBenchmarkPure, :generator_ascii, :load => yes
218
- benchmark GeneratorBenchmarkRails, :generator, :load => yes
219
- benchmark GeneratorBenchmarkYajl, :generator, :load => yes
220
- benchmark GeneratorBenchmarkYajl, :generator_gem_api, :load => yes
221
- end
222
- end
223
- end
224
-