engineyard-serverside 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/engineyard-serverside.rb +3 -3
- data/lib/engineyard-serverside/configuration.rb +6 -6
- data/lib/engineyard-serverside/deploy.rb +11 -7
- data/lib/engineyard-serverside/version.rb +1 -1
- data/lib/vendor/multi_json/CHANGELOG.md +121 -0
- data/lib/vendor/multi_json/CONTRIBUTING.md +46 -0
- data/lib/vendor/multi_json/Gemfile +31 -0
- data/lib/vendor/multi_json/LICENSE.md +20 -0
- data/lib/vendor/multi_json/README.md +105 -0
- data/lib/vendor/multi_json/Rakefile +12 -0
- data/lib/vendor/multi_json/lib/multi_json.rb +137 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/gson.rb +20 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/json_common.rb +35 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/json_gem.rb +12 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/json_pure.rb +12 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/nsjsonserialization.rb +35 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/oj.rb +29 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/ok_json.rb +58 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/yajl.rb +20 -0
- data/lib/vendor/multi_json/lib/multi_json/vendor/okjson.rb +602 -0
- data/lib/vendor/multi_json/lib/multi_json/version.rb +3 -0
- data/lib/vendor/multi_json/multi_json.gemspec +22 -0
- data/lib/vendor/multi_json/spec/adapter_shared_example.rb +162 -0
- data/lib/vendor/multi_json/spec/helper.rb +45 -0
- data/lib/vendor/multi_json/spec/json_common_shared_example.rb +36 -0
- data/lib/vendor/multi_json/spec/multi_json_spec.rb +151 -0
- data/spec/configuration_spec.rb +79 -1
- data/spec/deploy_hook_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +26 -120
- data/lib/vendor/json_pure/CHANGES +0 -166
- data/lib/vendor/json_pure/COPYING +0 -58
- data/lib/vendor/json_pure/GPL +0 -340
- data/lib/vendor/json_pure/README +0 -358
- data/lib/vendor/json_pure/Rakefile +0 -292
- data/lib/vendor/json_pure/TODO +0 -1
- data/lib/vendor/json_pure/VERSION +0 -1
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +0 -52
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +0 -900
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +0 -901
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +0 -261
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +0 -262
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +0 -82
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +0 -34
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +0 -900
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +0 -901
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +0 -81
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +0 -82
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +0 -82
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +0 -82
- data/lib/vendor/json_pure/benchmarks/generator2_benchmark.rb +0 -222
- data/lib/vendor/json_pure/benchmarks/generator_benchmark.rb +0 -224
- data/lib/vendor/json_pure/benchmarks/ohai.json +0 -1216
- data/lib/vendor/json_pure/benchmarks/ohai.ruby +0 -1
- data/lib/vendor/json_pure/benchmarks/parser2_benchmark.rb +0 -251
- data/lib/vendor/json_pure/benchmarks/parser_benchmark.rb +0 -259
- data/lib/vendor/json_pure/bin/edit_json.rb +0 -9
- data/lib/vendor/json_pure/bin/prettify_json.rb +0 -75
- data/lib/vendor/json_pure/data/example.json +0 -1
- data/lib/vendor/json_pure/data/index.html +0 -38
- data/lib/vendor/json_pure/data/prototype.js +0 -4184
- data/lib/vendor/json_pure/ext/json/ext/generator/extconf.rb +0 -16
- data/lib/vendor/json_pure/ext/json/ext/generator/generator.c +0 -1323
- data/lib/vendor/json_pure/ext/json/ext/generator/generator.h +0 -170
- data/lib/vendor/json_pure/ext/json/ext/parser/extconf.rb +0 -15
- data/lib/vendor/json_pure/ext/json/ext/parser/parser.c +0 -1935
- data/lib/vendor/json_pure/ext/json/ext/parser/parser.h +0 -71
- data/lib/vendor/json_pure/ext/json/ext/parser/parser.rl +0 -792
- data/lib/vendor/json_pure/install.rb +0 -26
- data/lib/vendor/json_pure/lib/json.rb +0 -10
- data/lib/vendor/json_pure/lib/json/Array.xpm +0 -21
- data/lib/vendor/json_pure/lib/json/FalseClass.xpm +0 -21
- data/lib/vendor/json_pure/lib/json/Hash.xpm +0 -21
- data/lib/vendor/json_pure/lib/json/Key.xpm +0 -73
- data/lib/vendor/json_pure/lib/json/NilClass.xpm +0 -21
- data/lib/vendor/json_pure/lib/json/Numeric.xpm +0 -28
- data/lib/vendor/json_pure/lib/json/String.xpm +0 -96
- data/lib/vendor/json_pure/lib/json/TrueClass.xpm +0 -21
- data/lib/vendor/json_pure/lib/json/add/core.rb +0 -148
- data/lib/vendor/json_pure/lib/json/add/rails.rb +0 -58
- data/lib/vendor/json_pure/lib/json/common.rb +0 -397
- data/lib/vendor/json_pure/lib/json/editor.rb +0 -1371
- data/lib/vendor/json_pure/lib/json/ext.rb +0 -15
- data/lib/vendor/json_pure/lib/json/json.xpm +0 -1499
- data/lib/vendor/json_pure/lib/json/pure.rb +0 -77
- data/lib/vendor/json_pure/lib/json/pure/generator.rb +0 -452
- data/lib/vendor/json_pure/lib/json/pure/parser.rb +0 -307
- data/lib/vendor/json_pure/lib/json/version.rb +0 -8
- data/lib/vendor/json_pure/tests/fixtures/fail1.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail10.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail11.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail12.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail13.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail14.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail18.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail19.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail2.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail20.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail21.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail22.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail23.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail24.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail25.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail27.json +0 -2
- data/lib/vendor/json_pure/tests/fixtures/fail28.json +0 -2
- data/lib/vendor/json_pure/tests/fixtures/fail3.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail4.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail5.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail6.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail7.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail8.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail9.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass1.json +0 -56
- data/lib/vendor/json_pure/tests/fixtures/pass15.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass16.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass17.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass2.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass26.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass3.json +0 -6
- data/lib/vendor/json_pure/tests/test_json.rb +0 -361
- data/lib/vendor/json_pure/tests/test_json_addition.rb +0 -162
- data/lib/vendor/json_pure/tests/test_json_encoding.rb +0 -68
- data/lib/vendor/json_pure/tests/test_json_fixtures.rb +0 -34
- data/lib/vendor/json_pure/tests/test_json_generate.rb +0 -122
- data/lib/vendor/json_pure/tests/test_json_rails.rb +0 -144
- data/lib/vendor/json_pure/tests/test_json_unicode.rb +0 -76
- data/lib/vendor/json_pure/tools/fuzz.rb +0 -139
- data/lib/vendor/json_pure/tools/server.rb +0 -61
@@ -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
|
-
|