engineyard-serverside 1.5.23.ruby19.16 → 1.5.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. data/lib/engineyard-serverside.rb +19 -17
  2. data/lib/engineyard-serverside/cli.rb +38 -30
  3. data/lib/engineyard-serverside/configuration.rb +4 -28
  4. data/lib/engineyard-serverside/deploy.rb +10 -7
  5. data/lib/engineyard-serverside/lockfile_parser.rb +2 -2
  6. data/lib/engineyard-serverside/logged_output.rb +2 -0
  7. data/lib/engineyard-serverside/server.rb +2 -27
  8. data/lib/engineyard-serverside/task.rb +14 -10
  9. data/lib/engineyard-serverside/version.rb +1 -1
  10. data/lib/vendor/dataflow/HISTORY +52 -0
  11. data/lib/vendor/dataflow/LICENSE +19 -0
  12. data/lib/vendor/dataflow/README.textile +290 -0
  13. data/lib/vendor/dataflow/Rakefile +36 -0
  14. data/lib/vendor/dataflow/examples/barrier.rb +9 -0
  15. data/lib/vendor/dataflow/examples/data_driven.rb +17 -0
  16. data/lib/vendor/dataflow/examples/dataflow_http_gets.rb +13 -0
  17. data/lib/vendor/dataflow/examples/flow.rb +20 -0
  18. data/lib/vendor/dataflow/examples/future_http_gets.rb +12 -0
  19. data/lib/vendor/dataflow/examples/future_queue.rb +11 -0
  20. data/lib/vendor/dataflow/examples/instance_variables.rb +15 -0
  21. data/lib/vendor/dataflow/examples/laziness.rb +9 -0
  22. data/lib/vendor/dataflow/examples/local_variables.rb +11 -0
  23. data/lib/vendor/dataflow/examples/messages.rb +26 -0
  24. data/lib/vendor/dataflow/examples/port_http_gets.rb +13 -0
  25. data/lib/vendor/dataflow/examples/port_send.rb +10 -0
  26. data/lib/vendor/dataflow/examples/ring.rb +21 -0
  27. data/lib/vendor/dataflow/spec/actor_spec.rb +28 -0
  28. data/lib/vendor/dataflow/spec/anonymous_variables_spec.rb +21 -0
  29. data/lib/vendor/dataflow/spec/barrier_spec.rb +25 -0
  30. data/lib/vendor/dataflow/spec/by_need_spec.rb +55 -0
  31. data/lib/vendor/dataflow/spec/dataflow_spec.rb +151 -0
  32. data/lib/vendor/dataflow/spec/equality_spec.rb +40 -0
  33. data/lib/vendor/dataflow/spec/flow_spec.rb +25 -0
  34. data/lib/vendor/dataflow/spec/forker_spec.rb +28 -0
  35. data/lib/vendor/dataflow/spec/future_queue_spec.rb +31 -0
  36. data/lib/vendor/dataflow/spec/inspect_spec.rb +19 -0
  37. data/lib/vendor/dataflow/spec/need_later_spec.rb +12 -0
  38. data/lib/vendor/dataflow/spec/port_spec.rb +26 -0
  39. data/lib/vendor/dataflow/spec/spec.opts +1 -0
  40. data/lib/vendor/dataflow/spec/spec_helper.rb +10 -0
  41. data/lib/vendor/escape/Readme +21 -0
  42. data/lib/vendor/escape/doc_include/template/qualitysmith.rb +631 -0
  43. data/lib/vendor/json_pure/CHANGES +166 -0
  44. data/lib/vendor/json_pure/COPYING +58 -0
  45. data/lib/vendor/json_pure/GPL +340 -0
  46. data/lib/vendor/json_pure/README +358 -0
  47. data/lib/vendor/json_pure/Rakefile +292 -0
  48. data/lib/vendor/json_pure/TODO +1 -0
  49. data/lib/vendor/json_pure/VERSION +1 -0
  50. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +52 -0
  51. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +1000 -0
  52. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +1001 -0
  53. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +900 -0
  54. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +901 -0
  55. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +1000 -0
  56. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +1001 -0
  57. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +261 -0
  58. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +1000 -0
  59. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +1001 -0
  60. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +1000 -0
  61. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +1001 -0
  62. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +1000 -0
  63. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +1001 -0
  64. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +262 -0
  65. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +1000 -0
  66. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +1001 -0
  67. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +82 -0
  68. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +34 -0
  69. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +900 -0
  70. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +901 -0
  71. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +81 -0
  72. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +1000 -0
  73. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +1001 -0
  74. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +82 -0
  75. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +1000 -0
  76. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +1001 -0
  77. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +82 -0
  78. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +1000 -0
  79. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +1001 -0
  80. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +82 -0
  81. data/lib/vendor/json_pure/benchmarks/generator2_benchmark.rb +222 -0
  82. data/lib/vendor/json_pure/benchmarks/generator_benchmark.rb +224 -0
  83. data/lib/vendor/json_pure/benchmarks/ohai.json +1216 -0
  84. data/lib/vendor/json_pure/benchmarks/ohai.ruby +1 -0
  85. data/lib/vendor/json_pure/benchmarks/parser2_benchmark.rb +251 -0
  86. data/lib/vendor/json_pure/benchmarks/parser_benchmark.rb +259 -0
  87. data/lib/vendor/json_pure/bin/edit_json.rb +9 -0
  88. data/lib/vendor/json_pure/bin/prettify_json.rb +75 -0
  89. data/lib/vendor/json_pure/data/example.json +1 -0
  90. data/lib/vendor/json_pure/data/index.html +38 -0
  91. data/lib/vendor/json_pure/data/prototype.js +4184 -0
  92. data/lib/vendor/json_pure/ext/json/ext/generator/extconf.rb +16 -0
  93. data/lib/vendor/json_pure/ext/json/ext/generator/generator.c +1323 -0
  94. data/lib/vendor/json_pure/ext/json/ext/generator/generator.h +170 -0
  95. data/lib/vendor/json_pure/ext/json/ext/parser/extconf.rb +15 -0
  96. data/lib/vendor/json_pure/ext/json/ext/parser/parser.c +1935 -0
  97. data/lib/vendor/json_pure/ext/json/ext/parser/parser.h +71 -0
  98. data/lib/vendor/json_pure/ext/json/ext/parser/parser.rl +792 -0
  99. data/lib/vendor/json_pure/install.rb +26 -0
  100. data/lib/vendor/json_pure/tests/fixtures/fail1.json +1 -0
  101. data/lib/vendor/json_pure/tests/fixtures/fail10.json +1 -0
  102. data/lib/vendor/json_pure/tests/fixtures/fail11.json +1 -0
  103. data/lib/vendor/json_pure/tests/fixtures/fail12.json +1 -0
  104. data/lib/vendor/json_pure/tests/fixtures/fail13.json +1 -0
  105. data/lib/vendor/json_pure/tests/fixtures/fail14.json +1 -0
  106. data/lib/vendor/json_pure/tests/fixtures/fail18.json +1 -0
  107. data/lib/vendor/json_pure/tests/fixtures/fail19.json +1 -0
  108. data/lib/vendor/json_pure/tests/fixtures/fail2.json +1 -0
  109. data/lib/vendor/json_pure/tests/fixtures/fail20.json +1 -0
  110. data/lib/vendor/json_pure/tests/fixtures/fail21.json +1 -0
  111. data/lib/vendor/json_pure/tests/fixtures/fail22.json +1 -0
  112. data/lib/vendor/json_pure/tests/fixtures/fail23.json +1 -0
  113. data/lib/vendor/json_pure/tests/fixtures/fail24.json +1 -0
  114. data/lib/vendor/json_pure/tests/fixtures/fail25.json +1 -0
  115. data/lib/vendor/json_pure/tests/fixtures/fail27.json +2 -0
  116. data/lib/vendor/json_pure/tests/fixtures/fail28.json +2 -0
  117. data/lib/vendor/json_pure/tests/fixtures/fail3.json +1 -0
  118. data/lib/vendor/json_pure/tests/fixtures/fail4.json +1 -0
  119. data/lib/vendor/json_pure/tests/fixtures/fail5.json +1 -0
  120. data/lib/vendor/json_pure/tests/fixtures/fail6.json +1 -0
  121. data/lib/vendor/json_pure/tests/fixtures/fail7.json +1 -0
  122. data/lib/vendor/json_pure/tests/fixtures/fail8.json +1 -0
  123. data/lib/vendor/json_pure/tests/fixtures/fail9.json +1 -0
  124. data/lib/vendor/json_pure/tests/fixtures/pass1.json +56 -0
  125. data/lib/vendor/json_pure/tests/fixtures/pass15.json +1 -0
  126. data/lib/vendor/json_pure/tests/fixtures/pass16.json +1 -0
  127. data/lib/vendor/json_pure/tests/fixtures/pass17.json +1 -0
  128. data/lib/vendor/json_pure/tests/fixtures/pass2.json +1 -0
  129. data/lib/vendor/json_pure/tests/fixtures/pass26.json +1 -0
  130. data/lib/vendor/json_pure/tests/fixtures/pass3.json +6 -0
  131. data/lib/vendor/json_pure/tests/test_json.rb +361 -0
  132. data/lib/vendor/json_pure/tests/test_json_addition.rb +162 -0
  133. data/lib/vendor/json_pure/tests/test_json_encoding.rb +68 -0
  134. data/lib/vendor/json_pure/tests/test_json_fixtures.rb +34 -0
  135. data/lib/vendor/json_pure/tests/test_json_generate.rb +122 -0
  136. data/lib/vendor/json_pure/tests/test_json_rails.rb +144 -0
  137. data/lib/vendor/json_pure/tests/test_json_unicode.rb +76 -0
  138. data/lib/vendor/json_pure/tools/fuzz.rb +139 -0
  139. data/lib/vendor/json_pure/tools/server.rb +61 -0
  140. data/lib/vendor/open4/lib/open4.rb +51 -80
  141. data/lib/vendor/thor/CHANGELOG.rdoc +89 -0
  142. data/lib/vendor/thor/LICENSE +20 -0
  143. data/lib/vendor/thor/README.rdoc +297 -0
  144. data/lib/vendor/thor/Thorfile +69 -0
  145. data/lib/vendor/thor/bin/rake2thor +86 -0
  146. data/lib/vendor/thor/bin/thor +6 -0
  147. data/lib/vendor/thor/thor.gemspec +120 -0
  148. data/spec/basic_deploy_spec.rb +1 -1
  149. data/spec/bundler_deploy_spec.rb +1 -1
  150. data/spec/nodejs_deploy_spec.rb +5 -2
  151. data/spec/rails31_deploy_spec.rb +3 -3
  152. data/spec/services_deploy_spec.rb +1 -1
  153. data/spec/support/integration.rb +1 -2
  154. metadata +165 -44
  155. data/lib/engineyard-serverside/future.rb +0 -29
  156. data/lib/engineyard-serverside/futures/celluloid.rb +0 -25
  157. data/lib/engineyard-serverside/futures/dataflow.rb +0 -31
  158. data/lib/vendor/celluloid/lib/celluloid.rb +0 -261
  159. data/lib/vendor/celluloid/lib/celluloid/actor.rb +0 -242
  160. data/lib/vendor/celluloid/lib/celluloid/actor_pool.rb +0 -54
  161. data/lib/vendor/celluloid/lib/celluloid/actor_proxy.rb +0 -75
  162. data/lib/vendor/celluloid/lib/celluloid/application.rb +0 -78
  163. data/lib/vendor/celluloid/lib/celluloid/calls.rb +0 -94
  164. data/lib/vendor/celluloid/lib/celluloid/core_ext.rb +0 -14
  165. data/lib/vendor/celluloid/lib/celluloid/events.rb +0 -14
  166. data/lib/vendor/celluloid/lib/celluloid/fiber.rb +0 -33
  167. data/lib/vendor/celluloid/lib/celluloid/fsm.rb +0 -141
  168. data/lib/vendor/celluloid/lib/celluloid/future.rb +0 -60
  169. data/lib/vendor/celluloid/lib/celluloid/links.rb +0 -61
  170. data/lib/vendor/celluloid/lib/celluloid/logger.rb +0 -32
  171. data/lib/vendor/celluloid/lib/celluloid/mailbox.rb +0 -124
  172. data/lib/vendor/celluloid/lib/celluloid/receivers.rb +0 -66
  173. data/lib/vendor/celluloid/lib/celluloid/registry.rb +0 -33
  174. data/lib/vendor/celluloid/lib/celluloid/responses.rb +0 -26
  175. data/lib/vendor/celluloid/lib/celluloid/rspec.rb +0 -2
  176. data/lib/vendor/celluloid/lib/celluloid/signals.rb +0 -50
  177. data/lib/vendor/celluloid/lib/celluloid/supervisor.rb +0 -57
  178. data/lib/vendor/celluloid/lib/celluloid/task.rb +0 -73
  179. data/lib/vendor/celluloid/lib/celluloid/tcp_server.rb +0 -33
  180. data/lib/vendor/celluloid/lib/celluloid/timers.rb +0 -109
  181. data/lib/vendor/celluloid/lib/celluloid/version.rb +0 -4
@@ -0,0 +1,82 @@
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'.
@@ -0,0 +1,222 @@
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
+
@@ -0,0 +1,224 @@
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
+