json_pure 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/CHANGES +9 -0
  2. data/Rakefile +47 -53
  3. data/VERSION +1 -1
  4. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +52 -0
  5. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +1000 -0
  6. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +1001 -0
  7. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +900 -0
  8. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +901 -0
  9. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +1000 -0
  10. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +1001 -0
  11. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +261 -0
  12. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +1000 -0
  13. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +1001 -0
  14. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +1000 -0
  15. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +1001 -0
  16. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +1000 -0
  17. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +1001 -0
  18. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +262 -0
  19. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +1000 -0
  20. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +1001 -0
  21. data/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +82 -0
  22. data/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +34 -0
  23. data/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +900 -0
  24. data/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +901 -0
  25. data/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +81 -0
  26. data/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +1000 -0
  27. data/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +1001 -0
  28. data/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +82 -0
  29. data/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +1000 -0
  30. data/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +1001 -0
  31. data/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +82 -0
  32. data/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +1000 -0
  33. data/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +1001 -0
  34. data/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +82 -0
  35. data/benchmarks/generator_benchmark.rb +162 -0
  36. data/benchmarks/parser_benchmark.rb +193 -0
  37. data/bin/edit_json.rb +0 -1
  38. data/bin/prettify_json.rb +0 -1
  39. data/doc-templates/main.txt +284 -0
  40. data/ext/json/ext/generator/extconf.rb +2 -0
  41. data/ext/json/ext/generator/generator.c +62 -18
  42. data/ext/json/ext/parser/extconf.rb +2 -0
  43. data/ext/json/ext/parser/parser.c +128 -81
  44. data/ext/json/ext/parser/parser.rl +31 -7
  45. data/ext/json/ext/parser/unicode.c +4 -4
  46. data/lib/json/add/core.rb +1 -1
  47. data/lib/json/editor.rb +11 -2
  48. data/lib/json/ext.rb +2 -0
  49. data/lib/json/pure/generator.rb +77 -41
  50. data/lib/json/pure/parser.rb +6 -2
  51. data/lib/json/pure.rb +2 -0
  52. data/lib/json/version.rb +1 -1
  53. data/lib/json.rb +0 -221
  54. data/tests/test_json.rb +7 -4
  55. data/tests/test_json_addition.rb +8 -5
  56. data/tests/test_json_fixtures.rb +6 -2
  57. data/tests/test_json_generate.rb +8 -2
  58. data/tests/test_json_rails.rb +30 -2
  59. data/tests/test_json_unicode.rb +8 -7
  60. data/tools/fuzz.rb +0 -1
  61. data/tools/server.rb +0 -1
  62. metadata +46 -9
  63. data/benchmarks/benchmark.txt +0 -133
  64. data/benchmarks/benchmark_generator.rb +0 -48
  65. data/benchmarks/benchmark_parser.rb +0 -26
  66. data/benchmarks/benchmark_rails.rb +0 -26
  67. data/tests/runner.rb +0 -25
@@ -0,0 +1,261 @@
1
+ ========================== 2009-04-01T16:53:42 CEST ===========================
2
+ Benchmarking on ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux].
3
+ Running 'GeneratorBenchmarkExt' for 1000 iterations/method (compare_time=real)
4
+ ===============================================================================
5
+
6
+ This first run is only for warmup.
7
+ GeneratorBenchmarkExt#generator_fast:
8
+ real total user system
9
+ sum 1.818191528 1.840000000 1.830000000 0.010000000
10
+ min 0.001368999 0.000000000 0.000000000 0.000000000
11
+ std- -0.000870656 -0.002702580 -0.002705600 -0.000306228
12
+ mean 0.001818192 0.001840000 0.001830000 0.000010000
13
+ std+ 0.004507039 0.006382580 0.006365600 0.000326228
14
+ max 0.026389122 0.030000000 0.030000000 0.010000000
15
+ std 0.002688848 0.004542580 0.004535600 0.000316228
16
+ std% 147.885830391 246.879359662 247.847020509 3162.277660168
17
+ harm 0.001475231 nan nan nan
18
+ geo 0.001529059 0.000000000 0.000000000 0.000000000
19
+ q1 0.001397133 0.000000000 0.000000000 0.000000000
20
+ med 0.001406908 0.000000000 0.000000000 0.000000000
21
+ q3 0.001425028 0.000000000 0.000000000 0.000000000
22
+ 1000 549.99706 0.001818192
23
+ calls calls/sec secs/call
24
+
25
+ 0.02514 -|
26
+ 0.02264 -|*
27
+ 0.02013 -|
28
+ 0.01763 -|
29
+ 0.01513 -|
30
+ 0.01263 -|
31
+ 0.01013 -|
32
+ 0.00762 -|
33
+ 0.00512 -|
34
+ 0.00262 -|**************************************************
35
+
36
+ Outliers detected with box plot algo (median=0.00141, iqr=0.00003, factor=3.00):
37
+ high=63 very_high=132
38
+
39
+ Ljung-Box statistics: q=15.00353 (alpha=0.05, df=50).
40
+ 0.00000 < 0.95000 => No autocorrelation was detected.
41
+
42
+ GeneratorBenchmarkExt#generator_fast:
43
+ real total user system
44
+ sum 1.826970100 1.830000000 1.820000000 0.010000000
45
+ min 0.001377106 0.000000000 0.000000000 0.000000000
46
+ std- -0.000992693 -0.002749527 -0.002708588 -0.000306228
47
+ mean 0.001826970 0.001830000 0.001820000 0.000010000
48
+ std+ 0.004646633 0.006409527 0.006348588 0.000326228
49
+ max 0.027617931 0.030000000 0.030000000 0.010000000
50
+ std 0.002819663 0.004579527 0.004528588 0.000316228
51
+ std% 154.335471491 250.247404066 248.823509412 3162.277660168
52
+ harm 0.001469225 nan nan nan
53
+ geo 0.001522946 0.000000000 0.000000000 0.000000000
54
+ q1 0.001402140 0.000000000 0.000000000 0.000000000
55
+ med 0.001411915 0.000000000 0.000000000 0.000000000
56
+ q3 0.001425982 0.000000000 0.000000000 0.000000000
57
+ 1000 547.35433 0.001826970
58
+ calls calls/sec secs/call
59
+
60
+ 0.02631 -|
61
+ 0.02368 -|*
62
+ 0.02106 -|
63
+ 0.01843 -|
64
+ 0.01581 -|
65
+ 0.01319 -|
66
+ 0.01056 -|
67
+ 0.00794 -|
68
+ 0.00531 -|
69
+ 0.00269 -|**************************************************
70
+
71
+ Outliers detected with box plot algo (median=0.00141, iqr=0.00002, factor=3.00):
72
+ high=84 very_high=91
73
+
74
+ Ljung-Box statistics: q=13.47105 (alpha=0.05, df=50).
75
+ 0.00000 < 0.95000 => No autocorrelation was detected.
76
+
77
+ No initial data truncated.
78
+ => System may have been in a steady state from the beginning.
79
+ -------------------------------------------------------------------------------
80
+
81
+ This first run is only for warmup.
82
+ GeneratorBenchmarkExt#generator_pretty:
83
+ real total user system
84
+ sum 2.625656843 2.590000000 2.580000000 0.010000000
85
+ min 0.002025127 0.000000000 0.000000000 0.000000000
86
+ std- -0.000656844 -0.002684440 -0.002689855 -0.000306228
87
+ mean 0.002625657 0.002590000 0.002580000 0.000010000
88
+ std+ 0.005908158 0.007864440 0.007849855 0.000326228
89
+ max 0.028638124 0.030000000 0.030000000 0.010000000
90
+ std 0.003282501 0.005274440 0.005269855 0.000316228
91
+ std% 125.016381076 203.646340853 204.257944451 3162.277660168
92
+ harm 0.002154247 nan nan nan
93
+ geo 0.002239052 0.000000000 0.000000000 0.000000000
94
+ q1 0.002051830 0.000000000 0.000000000 0.000000000
95
+ med 0.002062082 0.000000000 0.000000000 0.000000000
96
+ q3 0.002082050 0.000000000 0.000000000 0.000000000
97
+ 1000 380.85708 0.002625657
98
+ calls calls/sec secs/call
99
+
100
+ 0.02731 -|
101
+ 0.02465 -|*
102
+ 0.02198 -|
103
+ 0.01932 -|
104
+ 0.01666 -|
105
+ 0.01400 -|
106
+ 0.01134 -|
107
+ 0.00868 -|
108
+ 0.00602 -|
109
+ 0.00336 -|**************************************************
110
+
111
+ Outliers detected with box plot algo (median=0.00206, iqr=0.00003, factor=3.00):
112
+ high=98 very_high=107
113
+
114
+ Ljung-Box statistics: q=349.53704 (alpha=0.05, df=50).
115
+ 1.00000 >= 0.95000 => Autocorrelation was detected.
116
+
117
+ GeneratorBenchmarkExt#generator_pretty:
118
+ real total user system
119
+ sum 2.399331093 2.360000000 2.360000000 0.000000000
120
+ min 0.002033949 0.000000000 0.000000000 0.000000000
121
+ std- -0.000767217 -0.002736080 -0.002736080 0.000000000
122
+ mean 0.002665923 0.002622222 0.002622222 0.000000000
123
+ std+ 0.006099064 0.007980525 0.007980525 0.000000000
124
+ max 0.029814005 0.030000000 0.030000000 0.000000000
125
+ std 0.003433140 0.005358303 0.005358303 0.000000000
126
+ std% 128.778658745 204.342051806 204.342051806 nan
127
+ harm 0.002164550 nan nan nan
128
+ geo 0.002253865 0.000000000 0.000000000 0.000000000
129
+ q1 0.002059937 0.000000000 0.000000000 0.000000000
130
+ med 0.002071142 0.000000000 0.000000000 0.000000000
131
+ q3 0.002090931 0.000000000 0.000000000 0.000000000
132
+ 900 375.10455 0.002665923
133
+ calls calls/sec secs/call
134
+
135
+ 0.02843 -|
136
+ 0.02565 -|*
137
+ 0.02287 -|
138
+ 0.02009 -|
139
+ 0.01731 -|
140
+ 0.01453 -|
141
+ 0.01176 -|
142
+ 0.00898 -|
143
+ 0.00620 -|
144
+ 0.00342 -|**************************************************
145
+
146
+ Outliers detected with box plot algo (median=0.00207, iqr=0.00003, factor=3.00):
147
+ high=89 very_high=86
148
+
149
+ Ljung-Box statistics: q=342.52637 (alpha=0.05, df=50).
150
+ 1.00000 >= 0.95000 => Autocorrelation was detected.
151
+
152
+ Truncated initial 100 measurements: 1000 -> 900 (-10.00%).
153
+ -------------------------------------------------------------------------------
154
+
155
+ This first run is only for warmup.
156
+ GeneratorBenchmarkExt#generator_safe:
157
+ real total user system
158
+ sum 2.218419790 2.210000000 2.210000000 0.000000000
159
+ min 0.001708984 0.000000000 0.000000000 0.000000000
160
+ std- -0.000607850 -0.002484458 -0.002484458 0.000000000
161
+ mean 0.002218420 0.002210000 0.002210000 0.000000000
162
+ std+ 0.005044690 0.006904458 0.006904458 0.000000000
163
+ max 0.026993036 0.030000000 0.030000000 0.000000000
164
+ std 0.002826270 0.004694458 0.004694458 0.000000000
165
+ std% 127.400134370 212.418923782 212.418923782 nan
166
+ harm 0.001839661 nan nan nan
167
+ geo 0.001909029 0.000000000 0.000000000 0.000000000
168
+ q1 0.001738071 0.000000000 0.000000000 0.000000000
169
+ med 0.001749992 0.000000000 0.000000000 0.000000000
170
+ q3 0.001769066 0.000000000 0.000000000 0.000000000
171
+ 1000 450.77131 0.002218420
172
+ calls calls/sec secs/call
173
+
174
+ 0.02573 -|
175
+ 0.02320 -|
176
+ 0.02067 -|
177
+ 0.01814 -|
178
+ 0.01562 -|
179
+ 0.01309 -|
180
+ 0.01056 -|
181
+ 0.00803 -|
182
+ 0.00550 -|
183
+ 0.00297 -|**************************************************
184
+
185
+ Outliers detected with box plot algo (median=0.00175, iqr=0.00003, factor=3.00):
186
+ high=58 very_high=129
187
+
188
+ Ljung-Box statistics: q=24.03262 (alpha=0.05, df=50).
189
+ 0.00070 < 0.95000 => No autocorrelation was detected.
190
+
191
+ GeneratorBenchmarkExt#generator_safe:
192
+ real total user system
193
+ sum 2.252413511 2.250000000 2.250000000 0.000000000
194
+ min 0.001720905 0.000000000 0.000000000 0.000000000
195
+ std- -0.000940042 -0.002634809 -0.002634809 0.000000000
196
+ mean 0.002252414 0.002250000 0.002250000 0.000000000
197
+ std+ 0.005444869 0.007134809 0.007134809 0.000000000
198
+ max 0.030152082 0.030000000 0.030000000 0.000000000
199
+ std 0.003192455 0.004884809 0.004884809 0.000000000
200
+ std% 141.734856492 217.102633117 217.102633117 nan
201
+ harm 0.001827244 nan nan nan
202
+ geo 0.001895755 0.000000000 0.000000000 0.000000000
203
+ q1 0.001747131 0.000000000 0.000000000 0.000000000
204
+ med 0.001757145 0.000000000 0.000000000 0.000000000
205
+ q3 0.001773119 0.000000000 0.000000000 0.000000000
206
+ 1000 443.96821 0.002252414
207
+ calls calls/sec secs/call
208
+
209
+ 0.02873 -|
210
+ 0.02589 -|*
211
+ 0.02304 -|
212
+ 0.02020 -|
213
+ 0.01736 -|
214
+ 0.01451 -|
215
+ 0.01167 -|
216
+ 0.00883 -|
217
+ 0.00599 -|
218
+ 0.00314 -|**************************************************
219
+
220
+ Outliers detected with box plot algo (median=0.00176, iqr=0.00003, factor=3.00):
221
+ high=92 very_high=86
222
+
223
+ Ljung-Box statistics: q=19.23732 (alpha=0.05, df=50).
224
+ 0.00003 < 0.95000 => No autocorrelation was detected.
225
+
226
+ No initial data truncated.
227
+ => System may have been in a steady state from the beginning.
228
+ ========================== 2009-04-01T16:54:07 CEST ===========================
229
+
230
+ Comparing times (call_time_mean):
231
+ 1 GeneratorBenchmarkExt#generator_fast 1000 repeats:
232
+ 547.354332608 ( real) -> 1.459x
233
+ 0.001826970
234
+ 2 GeneratorBenchmarkExt#generator_safe 1000 repeats:
235
+ 443.968212317 ( real) -> 1.184x
236
+ 0.002252414
237
+ 3 GeneratorBenchmarkExt#generator_pretty 900 repeats:
238
+ 375.104545883 ( real) -> 1.000x
239
+ 0.002665923
240
+ calls/sec ( time) -> speed covers
241
+ secs/call
242
+
243
+ Comparing times (call_time_median):
244
+ 1 GeneratorBenchmarkExt#generator_fast 1000 repeats:
245
+ 708.258020939 ( real) -> 1.467x
246
+ 0.001411915
247
+ 2 GeneratorBenchmarkExt#generator_safe 1000 repeats:
248
+ 569.105020353 ( real) -> 1.179x
249
+ 0.001757145
250
+ 3 GeneratorBenchmarkExt#generator_pretty 900 repeats:
251
+ 482.825371244 ( real) -> 1.000x
252
+ 0.002071142
253
+ calls/sec ( time) -> speed covers
254
+ secs/call
255
+ ===============================================================================
256
+ Writing measurement data file '/data/scm/json/benchmarks/data/GeneratorBenchmarkExt#generator_fast.dat'.
257
+ Writing autocorrelation plot file '/data/scm/json/benchmarks/data/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat'.
258
+ Writing measurement data file '/data/scm/json/benchmarks/data/GeneratorBenchmarkExt#generator_pretty.dat'.
259
+ Writing autocorrelation plot file '/data/scm/json/benchmarks/data/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat'.
260
+ Writing measurement data file '/data/scm/json/benchmarks/data/GeneratorBenchmarkExt#generator_safe.dat'.
261
+ Writing autocorrelation plot file '/data/scm/json/benchmarks/data/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat'.