ffi-yajl 0.0.1-universal-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +201 -0
  3. data/README.md +17 -0
  4. data/Rakefile +62 -0
  5. data/bin/ffi-yajl-bench +36 -0
  6. data/ext/ffi_yajl/ext/encoder/encoder.c +240 -0
  7. data/ext/ffi_yajl/ext/encoder/extconf.rb +29 -0
  8. data/ext/ffi_yajl/ext/parser/extconf.rb +29 -0
  9. data/ext/ffi_yajl/ext/parser/parser.c +199 -0
  10. data/ext/libyajl2/extconf.rb +65 -0
  11. data/ext/libyajl2/vendored/.gitignore +3 -0
  12. data/ext/libyajl2/vendored/BUILDING +23 -0
  13. data/ext/libyajl2/vendored/BUILDING.win32 +27 -0
  14. data/ext/libyajl2/vendored/CMakeLists.txt +79 -0
  15. data/ext/libyajl2/vendored/COPYING +13 -0
  16. data/ext/libyajl2/vendored/ChangeLog +175 -0
  17. data/ext/libyajl2/vendored/README +74 -0
  18. data/ext/libyajl2/vendored/TODO +9 -0
  19. data/ext/libyajl2/vendored/YAJLDoc.cmake +26 -0
  20. data/ext/libyajl2/vendored/configure +79 -0
  21. data/ext/libyajl2/vendored/example/CMakeLists.txt +23 -0
  22. data/ext/libyajl2/vendored/example/README.md +7 -0
  23. data/ext/libyajl2/vendored/example/parse_config.c +69 -0
  24. data/ext/libyajl2/vendored/example/sample.config +101 -0
  25. data/ext/libyajl2/vendored/perf/CMakeLists.txt +23 -0
  26. data/ext/libyajl2/vendored/perf/documents.c +1418 -0
  27. data/ext/libyajl2/vendored/perf/documents.h +28 -0
  28. data/ext/libyajl2/vendored/perf/perftest.c +134 -0
  29. data/ext/libyajl2/vendored/reformatter/CMakeLists.txt +39 -0
  30. data/ext/libyajl2/vendored/reformatter/json_reformat.c +194 -0
  31. data/ext/libyajl2/vendored/src/CMakeLists.txt +86 -0
  32. data/ext/libyajl2/vendored/src/YAJL.dxy +1258 -0
  33. data/ext/libyajl2/vendored/src/api/yajl_common.h +75 -0
  34. data/ext/libyajl2/vendored/src/api/yajl_gen.h +157 -0
  35. data/ext/libyajl2/vendored/src/api/yajl_parse.h +226 -0
  36. data/ext/libyajl2/vendored/src/api/yajl_tree.h +185 -0
  37. data/ext/libyajl2/vendored/src/api/yajl_version.h.cmake +23 -0
  38. data/ext/libyajl2/vendored/src/yajl +33 -0
  39. data/ext/libyajl2/vendored/src/yajl.c +175 -0
  40. data/ext/libyajl2/vendored/src/yajl.pc.cmake +9 -0
  41. data/ext/libyajl2/vendored/src/yajl_alloc.c +52 -0
  42. data/ext/libyajl2/vendored/src/yajl_alloc.h +34 -0
  43. data/ext/libyajl2/vendored/src/yajl_buf.c +103 -0
  44. data/ext/libyajl2/vendored/src/yajl_buf.h +57 -0
  45. data/ext/libyajl2/vendored/src/yajl_bytestack.h +69 -0
  46. data/ext/libyajl2/vendored/src/yajl_encode.c +220 -0
  47. data/ext/libyajl2/vendored/src/yajl_encode.h +34 -0
  48. data/ext/libyajl2/vendored/src/yajl_gen.c +354 -0
  49. data/ext/libyajl2/vendored/src/yajl_lex.c +763 -0
  50. data/ext/libyajl2/vendored/src/yajl_lex.h +117 -0
  51. data/ext/libyajl2/vendored/src/yajl_parser.c +498 -0
  52. data/ext/libyajl2/vendored/src/yajl_parser.h +78 -0
  53. data/ext/libyajl2/vendored/src/yajl_tree.c +503 -0
  54. data/ext/libyajl2/vendored/src/yajl_version.c +7 -0
  55. data/ext/libyajl2/vendored/test/CMakeLists.txt +23 -0
  56. data/ext/libyajl2/vendored/test/cases/ac_difficult_json_c_test_case_with_comments.json +1 -0
  57. data/ext/libyajl2/vendored/test/cases/ac_difficult_json_c_test_case_with_comments.json.gold +36 -0
  58. data/ext/libyajl2/vendored/test/cases/ac_simple_with_comments.json +11 -0
  59. data/ext/libyajl2/vendored/test/cases/ac_simple_with_comments.json.gold +9 -0
  60. data/ext/libyajl2/vendored/test/cases/ag_false_then_garbage.json +1 -0
  61. data/ext/libyajl2/vendored/test/cases/ag_false_then_garbage.json.gold +2 -0
  62. data/ext/libyajl2/vendored/test/cases/ag_null_then_garbage.json +1 -0
  63. data/ext/libyajl2/vendored/test/cases/ag_null_then_garbage.json.gold +2 -0
  64. data/ext/libyajl2/vendored/test/cases/ag_true_then_garbage.json +1 -0
  65. data/ext/libyajl2/vendored/test/cases/ag_true_then_garbage.json.gold +2 -0
  66. data/ext/libyajl2/vendored/test/cases/am_eof.json +1 -0
  67. data/ext/libyajl2/vendored/test/cases/am_eof.json.gold +4 -0
  68. data/ext/libyajl2/vendored/test/cases/am_integers.json +1 -0
  69. data/ext/libyajl2/vendored/test/cases/am_integers.json.gold +3 -0
  70. data/ext/libyajl2/vendored/test/cases/am_multiple.json +3 -0
  71. data/ext/libyajl2/vendored/test/cases/am_multiple.json.gold +5 -0
  72. data/ext/libyajl2/vendored/test/cases/am_stuff.json +7 -0
  73. data/ext/libyajl2/vendored/test/cases/am_stuff.json.gold +14 -0
  74. data/ext/libyajl2/vendored/test/cases/ap_array_open.json +1 -0
  75. data/ext/libyajl2/vendored/test/cases/ap_array_open.json.gold +2 -0
  76. data/ext/libyajl2/vendored/test/cases/ap_eof_str.json +1 -0
  77. data/ext/libyajl2/vendored/test/cases/ap_eof_str.json.gold +1 -0
  78. data/ext/libyajl2/vendored/test/cases/ap_map_open.json +1 -0
  79. data/ext/libyajl2/vendored/test/cases/ap_map_open.json.gold +2 -0
  80. data/ext/libyajl2/vendored/test/cases/ap_partial_ok.json +1 -0
  81. data/ext/libyajl2/vendored/test/cases/ap_partial_ok.json.gold +4 -0
  82. data/ext/libyajl2/vendored/test/cases/array.json +6 -0
  83. data/ext/libyajl2/vendored/test/cases/array.json.gold +22 -0
  84. data/ext/libyajl2/vendored/test/cases/array_close.json +1 -0
  85. data/ext/libyajl2/vendored/test/cases/array_close.json.gold +2 -0
  86. data/ext/libyajl2/vendored/test/cases/bignums.json +1 -0
  87. data/ext/libyajl2/vendored/test/cases/bignums.json.gold +5 -0
  88. data/ext/libyajl2/vendored/test/cases/bogus_char.json +4 -0
  89. data/ext/libyajl2/vendored/test/cases/bogus_char.json.gold +10 -0
  90. data/ext/libyajl2/vendored/test/cases/codepoints_from_unicode_org.json +1 -0
  91. data/ext/libyajl2/vendored/test/cases/codepoints_from_unicode_org.json.gold +2 -0
  92. data/ext/libyajl2/vendored/test/cases/deep_arrays.json +1 -0
  93. data/ext/libyajl2/vendored/test/cases/deep_arrays.json.gold +2049 -0
  94. data/ext/libyajl2/vendored/test/cases/difficult_json_c_test_case.json +1 -0
  95. data/ext/libyajl2/vendored/test/cases/difficult_json_c_test_case.json.gold +36 -0
  96. data/ext/libyajl2/vendored/test/cases/doubles.json +1 -0
  97. data/ext/libyajl2/vendored/test/cases/doubles.json.gold +7 -0
  98. data/ext/libyajl2/vendored/test/cases/doubles_in_array.json +1 -0
  99. data/ext/libyajl2/vendored/test/cases/doubles_in_array.json.gold +8 -0
  100. data/ext/libyajl2/vendored/test/cases/empty_array.json +1 -0
  101. data/ext/libyajl2/vendored/test/cases/empty_array.json.gold +3 -0
  102. data/ext/libyajl2/vendored/test/cases/empty_string.json +1 -0
  103. data/ext/libyajl2/vendored/test/cases/empty_string.json.gold +2 -0
  104. data/ext/libyajl2/vendored/test/cases/escaped_bulgarian.json +4 -0
  105. data/ext/libyajl2/vendored/test/cases/escaped_bulgarian.json.gold +7 -0
  106. data/ext/libyajl2/vendored/test/cases/escaped_foobar.json +1 -0
  107. data/ext/libyajl2/vendored/test/cases/escaped_foobar.json.gold +2 -0
  108. data/ext/libyajl2/vendored/test/cases/false.json +1 -0
  109. data/ext/libyajl2/vendored/test/cases/false.json.gold +2 -0
  110. data/ext/libyajl2/vendored/test/cases/fg_false_then_garbage.json +1 -0
  111. data/ext/libyajl2/vendored/test/cases/fg_false_then_garbage.json.gold +3 -0
  112. data/ext/libyajl2/vendored/test/cases/fg_issue_7.json +1 -0
  113. data/ext/libyajl2/vendored/test/cases/fg_issue_7.json.gold +3 -0
  114. data/ext/libyajl2/vendored/test/cases/fg_null_then_garbage.json +1 -0
  115. data/ext/libyajl2/vendored/test/cases/fg_null_then_garbage.json.gold +3 -0
  116. data/ext/libyajl2/vendored/test/cases/fg_true_then_garbage.json +1 -0
  117. data/ext/libyajl2/vendored/test/cases/fg_true_then_garbage.json.gold +3 -0
  118. data/ext/libyajl2/vendored/test/cases/four_byte_utf8.json +2 -0
  119. data/ext/libyajl2/vendored/test/cases/four_byte_utf8.json.gold +5 -0
  120. data/ext/libyajl2/vendored/test/cases/high_overflow.json +1 -0
  121. data/ext/libyajl2/vendored/test/cases/high_overflow.json.gold +2 -0
  122. data/ext/libyajl2/vendored/test/cases/integers.json +3 -0
  123. data/ext/libyajl2/vendored/test/cases/integers.json.gold +14 -0
  124. data/ext/libyajl2/vendored/test/cases/invalid_utf8.json +1 -0
  125. data/ext/libyajl2/vendored/test/cases/invalid_utf8.json.gold +3 -0
  126. data/ext/libyajl2/vendored/test/cases/isolated_surrogate_marker.json +1 -0
  127. data/ext/libyajl2/vendored/test/cases/isolated_surrogate_marker.json.gold +2 -0
  128. data/ext/libyajl2/vendored/test/cases/leading_zero_in_number.json +1 -0
  129. data/ext/libyajl2/vendored/test/cases/leading_zero_in_number.json.gold +5 -0
  130. data/ext/libyajl2/vendored/test/cases/lonely_minus_sign.json +7 -0
  131. data/ext/libyajl2/vendored/test/cases/lonely_minus_sign.json.gold +9 -0
  132. data/ext/libyajl2/vendored/test/cases/lonely_number.json +1 -0
  133. data/ext/libyajl2/vendored/test/cases/lonely_number.json.gold +2 -0
  134. data/ext/libyajl2/vendored/test/cases/low_overflow.json +1 -0
  135. data/ext/libyajl2/vendored/test/cases/low_overflow.json.gold +2 -0
  136. data/ext/libyajl2/vendored/test/cases/map_close.json +1 -0
  137. data/ext/libyajl2/vendored/test/cases/map_close.json.gold +2 -0
  138. data/ext/libyajl2/vendored/test/cases/missing_integer_after_decimal_point.json +1 -0
  139. data/ext/libyajl2/vendored/test/cases/missing_integer_after_decimal_point.json.gold +2 -0
  140. data/ext/libyajl2/vendored/test/cases/missing_integer_after_exponent.json +1 -0
  141. data/ext/libyajl2/vendored/test/cases/missing_integer_after_exponent.json.gold +2 -0
  142. data/ext/libyajl2/vendored/test/cases/multiple.json +3 -0
  143. data/ext/libyajl2/vendored/test/cases/multiple.json.gold +4 -0
  144. data/ext/libyajl2/vendored/test/cases/non_utf8_char_in_string.json +1 -0
  145. data/ext/libyajl2/vendored/test/cases/non_utf8_char_in_string.json.gold +8 -0
  146. data/ext/libyajl2/vendored/test/cases/np_partial_bad.json +1 -0
  147. data/ext/libyajl2/vendored/test/cases/np_partial_bad.json.gold +5 -0
  148. data/ext/libyajl2/vendored/test/cases/null.json +1 -0
  149. data/ext/libyajl2/vendored/test/cases/null.json.gold +2 -0
  150. data/ext/libyajl2/vendored/test/cases/nulls_and_bools.json +5 -0
  151. data/ext/libyajl2/vendored/test/cases/nulls_and_bools.json.gold +9 -0
  152. data/ext/libyajl2/vendored/test/cases/simple.json +5 -0
  153. data/ext/libyajl2/vendored/test/cases/simple.json.gold +9 -0
  154. data/ext/libyajl2/vendored/test/cases/simple_with_comments.json +11 -0
  155. data/ext/libyajl2/vendored/test/cases/simple_with_comments.json.gold +5 -0
  156. data/ext/libyajl2/vendored/test/cases/string_invalid_escape.json +1 -0
  157. data/ext/libyajl2/vendored/test/cases/string_invalid_escape.json.gold +3 -0
  158. data/ext/libyajl2/vendored/test/cases/string_invalid_hex_char.json +1 -0
  159. data/ext/libyajl2/vendored/test/cases/string_invalid_hex_char.json.gold +2 -0
  160. data/ext/libyajl2/vendored/test/cases/string_with_escapes.json +3 -0
  161. data/ext/libyajl2/vendored/test/cases/string_with_escapes.json.gold +7 -0
  162. data/ext/libyajl2/vendored/test/cases/string_with_invalid_newline.json +2 -0
  163. data/ext/libyajl2/vendored/test/cases/string_with_invalid_newline.json.gold +2 -0
  164. data/ext/libyajl2/vendored/test/cases/three_byte_utf8.json +1 -0
  165. data/ext/libyajl2/vendored/test/cases/three_byte_utf8.json.gold +7 -0
  166. data/ext/libyajl2/vendored/test/cases/true.json +1 -0
  167. data/ext/libyajl2/vendored/test/cases/true.json.gold +2 -0
  168. data/ext/libyajl2/vendored/test/cases/unescaped_bulgarian.json +1 -0
  169. data/ext/libyajl2/vendored/test/cases/unescaped_bulgarian.json.gold +4 -0
  170. data/ext/libyajl2/vendored/test/cases/zerobyte.json +1 -0
  171. data/ext/libyajl2/vendored/test/cases/zerobyte.json.gold +0 -0
  172. data/ext/libyajl2/vendored/test/run_tests.sh +94 -0
  173. data/ext/libyajl2/vendored/test/yajl_test.c +281 -0
  174. data/ext/libyajl2/vendored/verify/CMakeLists.txt +39 -0
  175. data/ext/libyajl2/vendored/verify/json_verify.c +116 -0
  176. data/lib/ffi_yajl.rb +14 -0
  177. data/lib/ffi_yajl/benchmark.rb +7 -0
  178. data/lib/ffi_yajl/benchmark/MIT-LICENSE +20 -0
  179. data/lib/ffi_yajl/benchmark/encode.rb +135 -0
  180. data/lib/ffi_yajl/benchmark/encode_json_and_marshal.rb +42 -0
  181. data/lib/ffi_yajl/benchmark/encode_json_and_yaml.rb +53 -0
  182. data/lib/ffi_yajl/benchmark/encode_profile.rb +38 -0
  183. data/lib/ffi_yajl/benchmark/http.rb +32 -0
  184. data/lib/ffi_yajl/benchmark/parse.rb +133 -0
  185. data/lib/ffi_yajl/benchmark/parse_json_and_marshal.rb +50 -0
  186. data/lib/ffi_yajl/benchmark/parse_json_and_yaml.rb +55 -0
  187. data/lib/ffi_yajl/benchmark/parse_profile.rb +37 -0
  188. data/lib/ffi_yajl/benchmark/parse_profile_ruby_prof.rb +39 -0
  189. data/lib/ffi_yajl/benchmark/parse_stream.rb +54 -0
  190. data/lib/ffi_yajl/benchmark/subjects/item.json +1 -0
  191. data/lib/ffi_yajl/benchmark/subjects/ohai.json +1216 -0
  192. data/lib/ffi_yajl/benchmark/subjects/ohai.marshal_dump +0 -0
  193. data/lib/ffi_yajl/benchmark/subjects/ohai.yml +975 -0
  194. data/lib/ffi_yajl/benchmark/subjects/twitter_search.json +1 -0
  195. data/lib/ffi_yajl/benchmark/subjects/twitter_stream.json +430 -0
  196. data/lib/ffi_yajl/benchmark/subjects/unicode.json +1 -0
  197. data/lib/ffi_yajl/encoder.rb +53 -0
  198. data/lib/ffi_yajl/ext.rb +22 -0
  199. data/lib/ffi_yajl/ext/.keep +0 -0
  200. data/lib/ffi_yajl/ffi.rb +129 -0
  201. data/lib/ffi_yajl/ffi/encoder.rb +175 -0
  202. data/lib/ffi_yajl/ffi/parser.rb +145 -0
  203. data/lib/ffi_yajl/json_gem.rb +121 -0
  204. data/lib/ffi_yajl/parser.rb +23 -0
  205. data/lib/ffi_yajl/version.rb +3 -0
  206. data/lib/libyajl.so +0 -0
  207. data/lib/libyajl.so.2 +0 -0
  208. data/lib/libyajl.so.2.0.5 +0 -0
  209. data/lib/libyajl_s.a +0 -0
  210. data/spec/ffi_yajl/encoder_spec.rb +39 -0
  211. data/spec/ffi_yajl/json_gem_spec.rb +355 -0
  212. data/spec/ffi_yajl/parser_spec.rb +78 -0
  213. data/spec/spec_helper.rb +14 -0
  214. metadata +330 -0
@@ -0,0 +1,50 @@
1
+ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/..')
2
+ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
3
+
4
+ require 'rubygems'
5
+ require 'benchmark'
6
+ require 'yajl'
7
+ begin
8
+ require 'json'
9
+ rescue LoadError
10
+ end
11
+
12
+ # JSON section
13
+ filename = 'benchmark/subjects/ohai.json'
14
+ marshal_filename = 'benchmark/subjects/ohai.marshal_dump'
15
+ json = File.new(filename, 'r')
16
+ marshal_file = File.new(marshal_filename, 'r')
17
+
18
+ hash = {}
19
+
20
+ times = ARGV[0] ? ARGV[0].to_i : 1000
21
+ puts "Starting benchmark parsing #{File.size(filename)} bytes of JSON data #{times} times\n\n"
22
+ Benchmark.bmbm { |x|
23
+ x.report {
24
+ puts "Yajl::Parser#parse"
25
+ yajl = Yajl::Parser.new
26
+ yajl.on_parse_complete = lambda {|obj|} if times > 1
27
+ times.times {
28
+ json.rewind
29
+ hash = yajl.parse(json)
30
+ }
31
+ }
32
+ if defined?(JSON)
33
+ x.report {
34
+ puts "JSON.parse"
35
+ times.times {
36
+ json.rewind
37
+ JSON.parse(json.read, :max_nesting => false)
38
+ }
39
+ }
40
+ end
41
+ x.report {
42
+ puts "Marshal.load"
43
+ times.times {
44
+ marshal_file.rewind
45
+ Marshal.load(marshal_file)
46
+ }
47
+ }
48
+ }
49
+ json.close
50
+ marshal_file.close
@@ -0,0 +1,55 @@
1
+ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/..')
2
+ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
3
+
4
+ require 'rubygems'
5
+ require 'benchmark'
6
+ require 'yajl'
7
+ begin
8
+ require 'json'
9
+ rescue LoadError
10
+ end
11
+ require 'yaml'
12
+
13
+ # JSON section
14
+ filename = 'benchmark/subjects/ohai.json'
15
+ json = File.new(filename, 'r')
16
+
17
+ times = ARGV[0] ? ARGV[0].to_i : 1000
18
+ puts "Starting benchmark parsing #{File.size(filename)} bytes of JSON data #{times} times\n\n"
19
+ Benchmark.bmbm { |x|
20
+ parser = Yajl::Parser.new
21
+ parser.on_parse_complete = lambda {|obj|} if times > 1
22
+ x.report {
23
+ puts "Yajl::Parser#parse"
24
+ times.times {
25
+ json.rewind
26
+ parser.parse(json)
27
+ }
28
+ }
29
+ if defined?(JSON)
30
+ x.report {
31
+ puts "JSON.parse"
32
+ times.times {
33
+ json.rewind
34
+ JSON.parse(json.read, :max_nesting => false)
35
+ }
36
+ }
37
+ end
38
+ }
39
+ json.close
40
+
41
+ # YAML section
42
+ filename = 'benchmark/subjects/ohai.yml'
43
+ yaml = File.new(filename, 'r')
44
+
45
+ puts "Starting benchmark parsing #{File.size(filename)} bytes of YAML data #{times} times\n\n"
46
+ Benchmark.bmbm { |x|
47
+ x.report {
48
+ puts "YAML.load_stream"
49
+ times.times {
50
+ yaml.rewind
51
+ YAML.load(yaml)
52
+ }
53
+ }
54
+ }
55
+ yaml.close
@@ -0,0 +1,37 @@
1
+ # Portions Originally Copyright (c) 2008-2011 Brian Lopez - http://github.com/brianmario
2
+ # See MIT-LICENSE
3
+
4
+ require 'rubygems'
5
+ require 'ffi_yajl'
6
+ begin
7
+ require 'perftools'
8
+ rescue Exception
9
+ puts "INFO: perftools.rb gem not installed"
10
+ end
11
+
12
+ ENV['CPUPROFILE_FREQUENCY'] = "4000"
13
+
14
+ module FFI_Yajl
15
+ class Benchmark
16
+ class ParseProfile
17
+
18
+ def run
19
+ if defined?(PerfTools)
20
+ filename = File.expand_path(File.join(File.dirname(__FILE__), "subjects", "ohai.json"))
21
+ json = File.new(filename, 'r').read
22
+
23
+ times = 1000
24
+ puts "Starting profiling encoding #{filename} #{times} times\n\n"
25
+
26
+ PerfTools::CpuProfiler.start("/tmp/ffi_yajl_encode_profile.out") do
27
+ times.times {
28
+ output = FFI_Yajl::Parser.parse(json)
29
+ }
30
+ end
31
+ system("pprof.rb --text /tmp/ffi_yajl_encode_profile.out")
32
+ end
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,39 @@
1
+ # Portions Originally Copyright (c) 2008-2011 Brian Lopez - http://github.com/brianmario
2
+ # See MIT-LICENSE
3
+
4
+ require 'rubygems'
5
+ require 'ffi_yajl'
6
+
7
+ module FFI_Yajl
8
+ class Benchmark
9
+ class ParseProfileRubyProf
10
+
11
+ def run
12
+ begin
13
+ require 'ruby-prof'
14
+ rescue Exception
15
+ puts "INFO: perftools.rb gem not installed"
16
+ end
17
+
18
+ if defined?(RubyProf)
19
+ filename = File.expand_path(File.join(File.dirname(__FILE__), "subjects", "ohai.json"))
20
+ json = File.new(filename, 'r').read
21
+
22
+ times = 1000
23
+ puts "Starting profiling encoding #{filename} #{times} times\n\n"
24
+
25
+ result = RubyProf.profile do
26
+ times.times {
27
+ output = FFI_Yajl::Parser.parse(json)
28
+ }
29
+ end
30
+
31
+ printer = RubyProf::GraphPrinter.new(result)
32
+ printer.print(STDOUT, {})
33
+
34
+ end
35
+ end
36
+
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,54 @@
1
+ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/..')
2
+ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
3
+
4
+ require 'rubygems'
5
+ require 'benchmark'
6
+ require 'yajl'
7
+ begin
8
+ require 'json'
9
+ rescue LoadError
10
+ end
11
+ begin
12
+ require 'active_support'
13
+ rescue LoadError
14
+ end
15
+
16
+ filename = 'benchmark/subjects/twitter_stream.json'
17
+ json = File.new(filename, 'r')
18
+
19
+ times = ARGV[0] ? ARGV[0].to_i : 100
20
+ puts "Starting benchmark parsing JSON stream (#{File.size(filename)} bytes of JSON data with 430 JSON separate strings) #{times} times\n\n"
21
+ Benchmark.bmbm { |x|
22
+ parser = Yajl::Parser.new
23
+ parser.on_parse_complete = lambda {|obj|}
24
+ x.report {
25
+ puts "Yajl::Parser#parse"
26
+ times.times {
27
+ json.rewind
28
+ parser.parse(json)
29
+ }
30
+ }
31
+ if defined?(JSON)
32
+ x.report {
33
+ puts "JSON.parse"
34
+ times.times {
35
+ json.rewind
36
+ while chunk = json.gets
37
+ JSON.parse(chunk, :max_nesting => false)
38
+ end
39
+ }
40
+ }
41
+ end
42
+ if defined?(ActiveSupport::JSON)
43
+ x.report {
44
+ puts "ActiveSupport::JSON.decode"
45
+ times.times {
46
+ json.rewind
47
+ while chunk = json.gets
48
+ ActiveSupport::JSON.decode(chunk)
49
+ end
50
+ }
51
+ }
52
+ end
53
+ }
54
+ json.close
@@ -0,0 +1 @@
1
+ {"item": {"name": "generated", "cached_tag_list": "", "updated_at": "2009-03-24T05:25:09Z", "updated_by_id": null, "price": 1.99, "delta": false, "cost": 0.597, "account_id": 16, "unit": null, "import_tag": null, "taxable": true, "id": 1, "created_by_id": null, "description": null, "company_id": 0, "sku": "06317-0306", "created_at": "2009-03-24T05:25:09Z", "active": true}}
@@ -0,0 +1,1216 @@
1
+ {
2
+ "command": {
3
+ "ps": "ps -ef"
4
+ },
5
+ "kernel": {
6
+ "modules": {
7
+ "org.virtualbox.kext.VBoxDrv": {
8
+ "size": 118784,
9
+ "version": "2.2.0",
10
+ "index": "114",
11
+ "refcount": "3"
12
+ },
13
+ "com.cisco.nke.ipsec": {
14
+ "size": 454656,
15
+ "version": "2.0.1",
16
+ "index": "111",
17
+ "refcount": "0"
18
+ },
19
+ "com.apple.driver.AppleAPIC": {
20
+ "size": 12288,
21
+ "version": "1.4",
22
+ "index": "26",
23
+ "refcount": "0"
24
+ },
25
+ "com.apple.driver.AirPort.Atheros": {
26
+ "size": 593920,
27
+ "version": "318.8.3",
28
+ "index": "88",
29
+ "refcount": "0"
30
+ },
31
+ "com.apple.driver.AppleIntelCPUPowerManagement": {
32
+ "size": 102400,
33
+ "version": "59.0.1",
34
+ "index": "22",
35
+ "refcount": "0"
36
+ },
37
+ "com.apple.iokit.IOStorageFamily": {
38
+ "size": 98304,
39
+ "version": "1.5.5",
40
+ "index": "44",
41
+ "refcount": "9"
42
+ },
43
+ "com.apple.iokit.IOATAPIProtocolTransport": {
44
+ "size": 16384,
45
+ "version": "1.5.2",
46
+ "index": "52",
47
+ "refcount": "0"
48
+ },
49
+ "com.apple.iokit.IOPCIFamily": {
50
+ "size": 65536,
51
+ "version": "2.5",
52
+ "index": "17",
53
+ "refcount": "18"
54
+ },
55
+ "com.apple.driver.AppleHPET": {
56
+ "size": 12288,
57
+ "version": "1.3",
58
+ "index": "33",
59
+ "refcount": "0"
60
+ },
61
+ "com.apple.driver.AppleUSBHub": {
62
+ "size": 49152,
63
+ "version": "3.2.7",
64
+ "index": "47",
65
+ "refcount": "0"
66
+ },
67
+ "com.apple.iokit.IOFireWireFamily": {
68
+ "size": 258048,
69
+ "version": "3.4.6",
70
+ "index": "49",
71
+ "refcount": "2"
72
+ },
73
+ "com.apple.driver.AppleUSBComposite": {
74
+ "size": 16384,
75
+ "version": "3.2.0",
76
+ "index": "60",
77
+ "refcount": "1"
78
+ },
79
+ "com.apple.driver.AppleIntelPIIXATA": {
80
+ "size": 36864,
81
+ "version": "2.0.0",
82
+ "index": "41",
83
+ "refcount": "0"
84
+ },
85
+ "com.apple.driver.AppleSmartBatteryManager": {
86
+ "size": 28672,
87
+ "version": "158.6.0",
88
+ "index": "32",
89
+ "refcount": "0"
90
+ },
91
+ "com.apple.filesystems.udf": {
92
+ "size": 233472,
93
+ "version": "2.0.2",
94
+ "index": "119",
95
+ "refcount": "0"
96
+ },
97
+ "com.apple.iokit.IOSMBusFamily": {
98
+ "size": 12288,
99
+ "version": "1.1",
100
+ "index": "27",
101
+ "refcount": "2"
102
+ },
103
+ "com.apple.iokit.IOACPIFamily": {
104
+ "size": 16384,
105
+ "version": "1.2.0",
106
+ "index": "18",
107
+ "refcount": "10"
108
+ },
109
+ "foo.tap": {
110
+ "size": 24576,
111
+ "version": "1.0",
112
+ "index": "113",
113
+ "refcount": "0"
114
+ },
115
+ "com.vmware.kext.vmx86": {
116
+ "size": 864256,
117
+ "version": "2.0.4",
118
+ "index": "104",
119
+ "refcount": "0"
120
+ },
121
+ "com.apple.iokit.CHUDUtils": {
122
+ "size": 28672,
123
+ "version": "200",
124
+ "index": "98",
125
+ "refcount": "0"
126
+ },
127
+ "org.virtualbox.kext.VBoxNetAdp": {
128
+ "size": 8192,
129
+ "version": "2.2.0",
130
+ "index": "117",
131
+ "refcount": "0"
132
+ },
133
+ "com.apple.filesystems.autofs": {
134
+ "size": 45056,
135
+ "version": "2.0.1",
136
+ "index": "109",
137
+ "refcount": "0"
138
+ },
139
+ "com.vmware.kext.vmnet": {
140
+ "size": 36864,
141
+ "version": "2.0.4",
142
+ "index": "108",
143
+ "refcount": "0"
144
+ },
145
+ "com.apple.driver.AppleACPIButtons": {
146
+ "size": 16384,
147
+ "version": "1.2.4",
148
+ "index": "30",
149
+ "refcount": "0"
150
+ },
151
+ "com.apple.driver.AppleFWOHCI": {
152
+ "size": 139264,
153
+ "version": "3.7.2",
154
+ "index": "50",
155
+ "refcount": "0"
156
+ },
157
+ "com.apple.iokit.IOSCSIArchitectureModelFamily": {
158
+ "size": 102400,
159
+ "version": "2.0.5",
160
+ "index": "51",
161
+ "refcount": "4"
162
+ },
163
+ "com.apple.iokit.IOSCSIBlockCommandsDevice": {
164
+ "size": 90112,
165
+ "version": "2.0.5",
166
+ "index": "57",
167
+ "refcount": "1"
168
+ },
169
+ "com.apple.driver.AppleACPIPCI": {
170
+ "size": 12288,
171
+ "version": "1.2.4",
172
+ "index": "31",
173
+ "refcount": "0"
174
+ },
175
+ "com.apple.security.seatbelt": {
176
+ "size": 98304,
177
+ "version": "107.10",
178
+ "index": "25",
179
+ "refcount": "0"
180
+ },
181
+ "com.apple.driver.AppleUpstreamUserClient": {
182
+ "size": 16384,
183
+ "version": "2.7.2",
184
+ "index": "100",
185
+ "refcount": "0"
186
+ },
187
+ "com.apple.kext.OSvKernDSPLib": {
188
+ "size": 12288,
189
+ "version": "1.1",
190
+ "index": "79",
191
+ "refcount": "1"
192
+ },
193
+ "com.apple.iokit.IOBDStorageFamily": {
194
+ "size": 20480,
195
+ "version": "1.5",
196
+ "index": "58",
197
+ "refcount": "1"
198
+ },
199
+ "com.apple.iokit.IOGraphicsFamily": {
200
+ "size": 118784,
201
+ "version": "1.7.1",
202
+ "index": "70",
203
+ "refcount": "5"
204
+ },
205
+ "com.apple.iokit.IONetworkingFamily": {
206
+ "size": 90112,
207
+ "version": "1.6.1",
208
+ "index": "82",
209
+ "refcount": "4"
210
+ },
211
+ "com.apple.iokit.IOATAFamily": {
212
+ "size": 53248,
213
+ "version": "2.0.0",
214
+ "index": "40",
215
+ "refcount": "2"
216
+ },
217
+ "com.apple.iokit.IOUSBHIDDriver": {
218
+ "size": 20480,
219
+ "version": "3.2.2",
220
+ "index": "63",
221
+ "refcount": "2"
222
+ },
223
+ "org.virtualbox.kext.VBoxUSB": {
224
+ "size": 28672,
225
+ "version": "2.2.0",
226
+ "index": "115",
227
+ "refcount": "0"
228
+ },
229
+ "com.vmware.kext.vmioplug": {
230
+ "size": 24576,
231
+ "version": "2.0.4",
232
+ "index": "107",
233
+ "refcount": "0"
234
+ },
235
+ "com.apple.security.TMSafetyNet": {
236
+ "size": 12288,
237
+ "version": "3",
238
+ "index": "23",
239
+ "refcount": "0"
240
+ },
241
+ "com.apple.iokit.IONDRVSupport": {
242
+ "size": 57344,
243
+ "version": "1.7.1",
244
+ "index": "71",
245
+ "refcount": "3"
246
+ },
247
+ "com.apple.BootCache": {
248
+ "size": 20480,
249
+ "version": "30.3",
250
+ "index": "20",
251
+ "refcount": "0"
252
+ },
253
+ "com.apple.iokit.IOUSBUserClient": {
254
+ "size": 8192,
255
+ "version": "3.2.4",
256
+ "index": "46",
257
+ "refcount": "1"
258
+ },
259
+ "com.apple.iokit.IOSCSIMultimediaCommandsDevice": {
260
+ "size": 90112,
261
+ "version": "2.0.5",
262
+ "index": "59",
263
+ "refcount": "0"
264
+ },
265
+ "com.apple.driver.AppleIRController": {
266
+ "size": 20480,
267
+ "version": "110",
268
+ "index": "78",
269
+ "refcount": "0"
270
+ },
271
+ "com.apple.driver.AudioIPCDriver": {
272
+ "size": 16384,
273
+ "version": "1.0.5",
274
+ "index": "81",
275
+ "refcount": "0"
276
+ },
277
+ "org.virtualbox.kext.VBoxNetFlt": {
278
+ "size": 16384,
279
+ "version": "2.2.0",
280
+ "index": "116",
281
+ "refcount": "0"
282
+ },
283
+ "com.apple.driver.AppleLPC": {
284
+ "size": 12288,
285
+ "version": "1.2.11",
286
+ "index": "73",
287
+ "refcount": "0"
288
+ },
289
+ "com.apple.iokit.CHUDKernLib": {
290
+ "size": 20480,
291
+ "version": "196",
292
+ "index": "93",
293
+ "refcount": "2"
294
+ },
295
+ "com.apple.iokit.CHUDProf": {
296
+ "size": 49152,
297
+ "version": "207",
298
+ "index": "97",
299
+ "refcount": "0"
300
+ },
301
+ "com.apple.NVDAResman": {
302
+ "size": 2478080,
303
+ "version": "5.3.6",
304
+ "index": "90",
305
+ "refcount": "2"
306
+ },
307
+ "com.apple.driver.AppleACPIEC": {
308
+ "size": 20480,
309
+ "version": "1.2.4",
310
+ "index": "28",
311
+ "refcount": "0"
312
+ },
313
+ "foo.tun": {
314
+ "size": 24576,
315
+ "version": "1.0",
316
+ "index": "118",
317
+ "refcount": "0"
318
+ },
319
+ "com.apple.iokit.IOSerialFamily": {
320
+ "size": 36864,
321
+ "version": "9.3",
322
+ "index": "102",
323
+ "refcount": "1"
324
+ },
325
+ "com.apple.GeForce": {
326
+ "size": 622592,
327
+ "version": "5.3.6",
328
+ "index": "96",
329
+ "refcount": "0"
330
+ },
331
+ "com.apple.iokit.IOCDStorageFamily": {
332
+ "size": 32768,
333
+ "version": "1.5",
334
+ "index": "55",
335
+ "refcount": "3"
336
+ },
337
+ "com.apple.driver.AppleUSBEHCI": {
338
+ "size": 73728,
339
+ "version": "3.2.5",
340
+ "index": "39",
341
+ "refcount": "0"
342
+ },
343
+ "com.apple.nvidia.nv50hal": {
344
+ "size": 2445312,
345
+ "version": "5.3.6",
346
+ "index": "91",
347
+ "refcount": "0"
348
+ },
349
+ "com.apple.driver.AppleSMBIOS": {
350
+ "size": 16384,
351
+ "version": "1.1.1",
352
+ "index": "29",
353
+ "refcount": "0"
354
+ },
355
+ "com.apple.driver.AppleBacklight": {
356
+ "size": 16384,
357
+ "version": "1.4.4",
358
+ "index": "72",
359
+ "refcount": "0"
360
+ },
361
+ "com.apple.driver.AppleACPIPlatform": {
362
+ "size": 253952,
363
+ "version": "1.2.4",
364
+ "index": "19",
365
+ "refcount": "3"
366
+ },
367
+ "com.apple.iokit.SCSITaskUserClient": {
368
+ "size": 24576,
369
+ "version": "2.0.5",
370
+ "index": "54",
371
+ "refcount": "0"
372
+ },
373
+ "com.apple.iokit.IOHIDFamily": {
374
+ "size": 233472,
375
+ "version": "1.5.3",
376
+ "index": "21",
377
+ "refcount": "7"
378
+ },
379
+ "com.apple.driver.DiskImages": {
380
+ "size": 65536,
381
+ "version": "195.2.2",
382
+ "index": "101",
383
+ "refcount": "0"
384
+ },
385
+ "com.apple.iokit.IODVDStorageFamily": {
386
+ "size": 24576,
387
+ "version": "1.5",
388
+ "index": "56",
389
+ "refcount": "2"
390
+ },
391
+ "com.apple.driver.XsanFilter": {
392
+ "size": 20480,
393
+ "version": "2.7.91",
394
+ "index": "53",
395
+ "refcount": "0"
396
+ },
397
+ "com.apple.driver.AppleEFIRuntime": {
398
+ "size": 12288,
399
+ "version": "1.2.0",
400
+ "index": "35",
401
+ "refcount": "1"
402
+ },
403
+ "com.apple.driver.AppleRTC": {
404
+ "size": 20480,
405
+ "version": "1.2.3",
406
+ "index": "34",
407
+ "refcount": "0"
408
+ },
409
+ "com.apple.iokit.IOFireWireIP": {
410
+ "size": 36864,
411
+ "version": "1.7.6",
412
+ "index": "83",
413
+ "refcount": "0"
414
+ },
415
+ "com.vmware.kext.vmci": {
416
+ "size": 45056,
417
+ "version": "2.0.4",
418
+ "index": "106",
419
+ "refcount": "0"
420
+ },
421
+ "com.apple.iokit.IO80211Family": {
422
+ "size": 126976,
423
+ "version": "215.1",
424
+ "index": "87",
425
+ "refcount": "1"
426
+ },
427
+ "com.apple.nke.applicationfirewall": {
428
+ "size": 32768,
429
+ "version": "1.0.77",
430
+ "index": "24",
431
+ "refcount": "0"
432
+ },
433
+ "com.apple.iokit.IOAHCIBlockStorage": {
434
+ "size": 69632,
435
+ "version": "1.2.0",
436
+ "index": "48",
437
+ "refcount": "0"
438
+ },
439
+ "com.apple.driver.AppleUSBUHCI": {
440
+ "size": 57344,
441
+ "version": "3.2.5",
442
+ "index": "38",
443
+ "refcount": "0"
444
+ },
445
+ "com.apple.iokit.IOAHCIFamily": {
446
+ "size": 24576,
447
+ "version": "1.5.0",
448
+ "index": "42",
449
+ "refcount": "2"
450
+ },
451
+ "com.apple.driver.AppleAHCIPort": {
452
+ "size": 53248,
453
+ "version": "1.5.2",
454
+ "index": "43",
455
+ "refcount": "0"
456
+ },
457
+ "com.apple.driver.AppleEFINVRAM": {
458
+ "size": 24576,
459
+ "version": "1.2.0",
460
+ "index": "36",
461
+ "refcount": "0"
462
+ },
463
+ "com.apple.iokit.IOUSBFamily": {
464
+ "size": 167936,
465
+ "version": "3.2.7",
466
+ "index": "37",
467
+ "refcount": "13"
468
+ },
469
+ "com.apple.driver.AppleUSBMergeNub": {
470
+ "size": 12288,
471
+ "version": "3.2.4",
472
+ "index": "61",
473
+ "refcount": "0"
474
+ }
475
+ },
476
+ "machine": "i386",
477
+ "name": "Darwin",
478
+ "os": "Darwin",
479
+ "version": "Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1\/RELEASE_I386",
480
+ "release": "9.6.0"
481
+ },
482
+ "platform_version": "10.5.6",
483
+ "platform": "mac_os_x",
484
+ "ipaddress": "192.168.88.1",
485
+ "keys": {
486
+ "ssh": {
487
+ "host_dsa_public": "private",
488
+ "host_rsa_public": "private"
489
+ }
490
+ },
491
+ "network": {
492
+ "settings": {
493
+ "net.inet6.ip6.forwarding": "0",
494
+ "net.inet.ip.dummynet.debug": "0",
495
+ "net.inet.ip.rtexpire": "10",
496
+ "net.inet6.ipsec6.esp_trans_deflev": "1",
497
+ "net.inet.tcp.tcbhashsize": "4096",
498
+ "net.key.esp_auth": "0",
499
+ "net.inet6.ip6.hlim": "64",
500
+ "net.inet.ip.fw.dyn_fin_lifetime": "1",
501
+ "net.inet.ip.fw.dyn_udp_lifetime": "10",
502
+ "net.inet.icmp.bmcastecho": "1",
503
+ "net.athforceBias": "2 2",
504
+ "net.athbgscan": "1 1",
505
+ "net.inet.tcp.reass.maxsegments": "2048",
506
+ "net.inet6.ip6.auto_flowlabel": "1",
507
+ "net.inet6.ip6.rtmaxcache": "128",
508
+ "net.inet.tcp.sendspace": "131072",
509
+ "net.inet.tcp.keepinit": "75000",
510
+ "net.inet.ip.dummynet.max_chain_len": "16",
511
+ "net.inet.tcp.rfc1644": "0",
512
+ "net.inet.ip.fw.curr_dyn_buckets": "256",
513
+ "net.inet.ip.dummynet.ready_heap": "0",
514
+ "net.inet.ip.portrange.first": "49152",
515
+ "net.inet.tcp.background_io_trigger": "5",
516
+ "net.link.ether.inet.host_down_time": "20",
517
+ "net.inet6.ipsec6.def_policy": "1",
518
+ "net.inet6.ipsec6.ecn": "0",
519
+ "net.inet.ip.fastforwarding": "0",
520
+ "net.athaddbaignore": "0 0",
521
+ "net.inet6.ip6.v6only": "0",
522
+ "net.inet.tcp.sack": "1",
523
+ "net.inet6.ip6.rtexpire": "3600",
524
+ "net.link.ether.inet.proxyall": "0",
525
+ "net.inet6.ip6.keepfaith": "0",
526
+ "net.key.spi_trycnt": "1000",
527
+ "net.link.ether.inet.prune_intvl": "300",
528
+ "net.inet.tcp.ecn_initiate_out": "0",
529
+ "net.inet.ip.fw.dyn_rst_lifetime": "1",
530
+ "net.local.stream.sendspace": "8192",
531
+ "net.inet.tcp.socket_unlocked_on_output": "1",
532
+ "net.inet.ip.fw.verbose_limit": "0",
533
+ "net.local.dgram.recvspace": "4096",
534
+ "net.inet.ipsec.debug": "0",
535
+ "net.link.ether.inet.log_arp_warnings": "0",
536
+ "net.inet.tcp.ecn_negotiate_in": "0",
537
+ "net.inet.tcp.rfc3465": "1",
538
+ "net.inet.tcp.icmp_may_rst": "1",
539
+ "net.link.ether.inet.sendllconflict": "0",
540
+ "net.inet.ipsec.ah_offsetmask": "0",
541
+ "net.key.blockacq_count": "10",
542
+ "net.inet.tcp.delayed_ack": "3",
543
+ "net.inet.ip.fw.verbose": "2",
544
+ "net.inet.ip.fw.dyn_count": "0",
545
+ "net.inet.tcp.slowlink_wsize": "8192",
546
+ "net.inet6.ip6.fw.enable": "1",
547
+ "net.inet.ip.portrange.hilast": "65535",
548
+ "net.inet.icmp.maskrepl": "0",
549
+ "net.link.ether.inet.apple_hwcksum_rx": "1",
550
+ "net.inet.tcp.drop_synfin": "1",
551
+ "net.key.spi_maxval": "268435455",
552
+ "net.inet.ipsec.ecn": "0",
553
+ "net.inet.ip.fw.dyn_keepalive": "1",
554
+ "net.key.int_random": "60",
555
+ "net.key.debug": "0",
556
+ "net.inet.ip.dummynet.curr_time": "0",
557
+ "net.inet.udp.blackhole": "0",
558
+ "net.athaggrqmin": "1 1",
559
+ "net.athppmenable": "1 1",
560
+ "net.inet.ip.fw.dyn_syn_lifetime": "20",
561
+ "net.inet.tcp.keepidle": "7200000",
562
+ "net.inet6.ip6.tempvltime": "604800",
563
+ "net.inet.tcp.recvspace": "358400",
564
+ "net.inet.tcp.keepintvl": "75000",
565
+ "net.inet.udp.maxdgram": "9216",
566
+ "net.inet.ip.maxchainsent": "0",
567
+ "net.inet.ipsec.esp_net_deflev": "1",
568
+ "net.inet6.icmp6.nd6_useloopback": "1",
569
+ "net.inet.tcp.slowstart_flightsize": "1",
570
+ "net.inet.ip.fw.debug": "0",
571
+ "net.inet.ip.linklocal.in.allowbadttl": "1",
572
+ "net.key.spi_minval": "256",
573
+ "net.inet.ip.forwarding": "0",
574
+ "net.inet.tcp.v6mssdflt": "1024",
575
+ "net.key.larval_lifetime": "30",
576
+ "net.inet6.ip6.fw.verbose_limit": "0",
577
+ "net.inet.ip.dummynet.red_lookup_depth": "256",
578
+ "net.inet.tcp.pcbcount": "36",
579
+ "net.inet.ip.fw.dyn_ack_lifetime": "300",
580
+ "net.inet.ip.portrange.lowlast": "600",
581
+ "net.athCCAThreshold": "28 28",
582
+ "net.link.ether.inet.useloopback": "1",
583
+ "net.athqdepth": "0 0",
584
+ "net.inet.ip.ttl": "64",
585
+ "net.inet.ip.rtmaxcache": "128",
586
+ "net.inet.ipsec.bypass": "0",
587
+ "net.inet6.icmp6.nd6_debug": "0",
588
+ "net.inet.ip.use_route_genid": "1",
589
+ "net.inet6.icmp6.rediraccept": "1",
590
+ "net.inet.ip.fw.static_count": "1",
591
+ "net.inet6.ip6.fw.debug": "0",
592
+ "net.inet.udp.pcbcount": "104",
593
+ "net.inet.ipsec.esp_randpad": "-1",
594
+ "net.inet6.icmp6.nd6_maxnudhint": "0",
595
+ "net.inet.tcp.always_keepalive": "0",
596
+ "net.inet.udp.checksum": "1",
597
+ "net.link.ether.inet.keep_announcements": "1",
598
+ "net.athfixedDropThresh": "150 150",
599
+ "net.inet6.ip6.kame_version": "20010528\/apple-darwin",
600
+ "net.inet.ip.fw.dyn_max": "4096",
601
+ "net.inet.udp.log_in_vain": "0",
602
+ "net.inet6.icmp6.nd6_mmaxtries": "3",
603
+ "net.inet.ip.rtminexpire": "10",
604
+ "net.inet.ip.fw.dyn_buckets": "256",
605
+ "net.inet6.ip6.accept_rtadv": "0",
606
+ "net.inet6.ip6.rr_prune": "5",
607
+ "net.key.ah_keymin": "128",
608
+ "net.inet.ip.redirect": "1",
609
+ "net.inet.tcp.sack_globalmaxholes": "65536",
610
+ "net.inet.ip.keepfaith": "0",
611
+ "net.inet.ip.dummynet.expire": "1",
612
+ "net.inet.ip.gifttl": "30",
613
+ "net.inet.ip.portrange.last": "65535",
614
+ "net.inet.ipsec.ah_net_deflev": "1",
615
+ "net.inet6.icmp6.nd6_delay": "5",
616
+ "net.inet.tcp.packetchain": "50",
617
+ "net.inet6.ip6.hdrnestlimit": "50",
618
+ "net.inet.tcp.newreno": "0",
619
+ "net.inet6.ip6.dad_count": "1",
620
+ "net.inet6.ip6.auto_linklocal": "1",
621
+ "net.inet6.ip6.temppltime": "86400",
622
+ "net.inet.tcp.strict_rfc1948": "0",
623
+ "net.athdupie": "1 1",
624
+ "net.inet.ip.dummynet.red_max_pkt_size": "1500",
625
+ "net.inet.ip.maxfrags": "2048",
626
+ "net.inet.tcp.log_in_vain": "0",
627
+ "net.inet.tcp.rfc1323": "1",
628
+ "net.inet.ip.subnets_are_local": "0",
629
+ "net.inet.ip.dummynet.search_steps": "0",
630
+ "net.inet.icmp.icmplim": "250",
631
+ "net.link.ether.inet.apple_hwcksum_tx": "1",
632
+ "net.inet6.icmp6.redirtimeout": "600",
633
+ "net.inet.ipsec.ah_cleartos": "1",
634
+ "net.inet6.ip6.log_interval": "5",
635
+ "net.link.ether.inet.max_age": "1200",
636
+ "net.inet.ip.fw.enable": "1",
637
+ "net.inet6.ip6.redirect": "1",
638
+ "net.athaggrfmax": "28 28",
639
+ "net.inet.ip.maxfragsperpacket": "128",
640
+ "net.inet6.ip6.use_deprecated": "1",
641
+ "net.link.generic.system.dlil_input_sanity_check": "0",
642
+ "net.inet.tcp.sack_globalholes": "0",
643
+ "net.inet.tcp.reass.cursegments": "0",
644
+ "net.inet6.icmp6.nodeinfo": "3",
645
+ "net.local.inflight": "0",
646
+ "net.inet.ip.dummynet.hash_size": "64",
647
+ "net.inet.ip.dummynet.red_avg_pkt_size": "512",
648
+ "net.inet.ipsec.dfbit": "0",
649
+ "net.inet.tcp.reass.overflows": "0",
650
+ "net.inet.tcp.rexmt_thresh": "2",
651
+ "net.inet6.ip6.maxfrags": "8192",
652
+ "net.inet6.ip6.rtminexpire": "10",
653
+ "net.inet6.ipsec6.esp_net_deflev": "1",
654
+ "net.inet.tcp.blackhole": "0",
655
+ "net.key.esp_keymin": "256",
656
+ "net.inet.ip.check_interface": "0",
657
+ "net.inet.tcp.minmssoverload": "0",
658
+ "net.link.ether.inet.maxtries": "5",
659
+ "net.inet.tcp.do_tcpdrain": "0",
660
+ "net.inet.ipsec.esp_port": "4500",
661
+ "net.inet6.ipsec6.ah_net_deflev": "1",
662
+ "net.inet.ip.dummynet.extract_heap": "0",
663
+ "net.inet.tcp.path_mtu_discovery": "1",
664
+ "net.inet.ip.intr_queue_maxlen": "50",
665
+ "net.inet.ipsec.def_policy": "1",
666
+ "net.inet.ip.fw.autoinc_step": "100",
667
+ "net.inet.ip.accept_sourceroute": "0",
668
+ "net.inet.raw.maxdgram": "8192",
669
+ "net.inet.ip.maxfragpackets": "1024",
670
+ "net.inet.ip.fw.one_pass": "0",
671
+ "net.appletalk.routermix": "2000",
672
+ "net.inet.tcp.tcp_lq_overflow": "1",
673
+ "net.link.generic.system.ifcount": "9",
674
+ "net.link.ether.inet.send_conflicting_probes": "1",
675
+ "net.inet.tcp.background_io_enabled": "1",
676
+ "net.inet6.ipsec6.debug": "0",
677
+ "net.inet.tcp.win_scale_factor": "3",
678
+ "net.key.natt_keepalive_interval": "20",
679
+ "net.inet.tcp.msl": "15000",
680
+ "net.inet.ip.portrange.hifirst": "49152",
681
+ "net.inet.ipsec.ah_trans_deflev": "1",
682
+ "net.inet.tcp.rtt_min": "1",
683
+ "net.inet6.ip6.defmcasthlim": "1",
684
+ "net.inet6.icmp6.nd6_prune": "1",
685
+ "net.inet6.ip6.fw.verbose": "0",
686
+ "net.inet.ip.portrange.lowfirst": "1023",
687
+ "net.inet.tcp.maxseg_unacked": "8",
688
+ "net.local.dgram.maxdgram": "2048",
689
+ "net.key.blockacq_lifetime": "20",
690
+ "net.inet.tcp.sack_maxholes": "128",
691
+ "net.inet6.ip6.maxfragpackets": "1024",
692
+ "net.inet6.ip6.use_tempaddr": "0",
693
+ "net.athpowermode": "0 0",
694
+ "net.inet.udp.recvspace": "73728",
695
+ "net.inet.tcp.isn_reseed_interval": "0",
696
+ "net.inet.tcp.local_slowstart_flightsize": "8",
697
+ "net.inet.ip.dummynet.searches": "0",
698
+ "net.inet.ip.intr_queue_drops": "0",
699
+ "net.link.generic.system.multi_threaded_input": "1",
700
+ "net.inet.raw.recvspace": "8192",
701
+ "net.inet.ipsec.esp_trans_deflev": "1",
702
+ "net.key.prefered_oldsa": "0",
703
+ "net.local.stream.recvspace": "8192",
704
+ "net.inet.tcp.sockthreshold": "64",
705
+ "net.inet6.icmp6.nd6_umaxtries": "3",
706
+ "net.pstimeout": "20 20",
707
+ "net.inet.ip.sourceroute": "0",
708
+ "net.inet.ip.fw.dyn_short_lifetime": "5",
709
+ "net.inet.tcp.minmss": "216",
710
+ "net.inet6.ip6.gifhlim": "0",
711
+ "net.athvendorie": "1 1",
712
+ "net.inet.ip.check_route_selfref": "1",
713
+ "net.inet6.icmp6.errppslimit": "100",
714
+ "net.inet.tcp.mssdflt": "512",
715
+ "net.inet.icmp.log_redirect": "0",
716
+ "net.inet6.ipsec6.ah_trans_deflev": "1",
717
+ "net.inet6.ipsec6.esp_randpad": "-1",
718
+ "net.inet.icmp.drop_redirect": "0",
719
+ "net.inet.icmp.timestamp": "0",
720
+ "net.inet.ip.random_id": "1"
721
+ },
722
+ "interfaces": {
723
+ "vmnet1": {
724
+ "flags": [
725
+ "UP",
726
+ "BROADCAST",
727
+ "SMART",
728
+ "RUNNING",
729
+ "SIMPLEX",
730
+ "MULTICAST"
731
+ ],
732
+ "addresses": [
733
+ {
734
+ "broadcast": "192.168.88.255",
735
+ "netmask": "255.255.255.0",
736
+ "family": "inet",
737
+ "address": "192.168.88.1"
738
+ },
739
+ {
740
+ "family": "lladdr",
741
+ "address": "private"
742
+ }
743
+ ],
744
+ "number": "1",
745
+ "mtu": "1500",
746
+ "type": "vmnet",
747
+ "encapsulation": "Ethernet"
748
+ },
749
+ "stf0": {
750
+ "flags": [
751
+
752
+ ],
753
+ "number": "0",
754
+ "mtu": "1280",
755
+ "type": "stf",
756
+ "encapsulation": "6to4"
757
+ },
758
+ "vboxnet0": {
759
+ "flags": [
760
+ "BROADCAST",
761
+ "RUNNING",
762
+ "SIMPLEX",
763
+ "MULTICAST"
764
+ ],
765
+ "addresses": [
766
+ {
767
+ "family": "lladdr",
768
+ "address": "private"
769
+ }
770
+ ],
771
+ "number": "0",
772
+ "mtu": "1500",
773
+ "type": "vboxnet",
774
+ "encapsulation": "Ethernet"
775
+ },
776
+ "lo0": {
777
+ "flags": [
778
+ "UP",
779
+ "LOOPBACK",
780
+ "RUNNING",
781
+ "MULTICAST"
782
+ ],
783
+ "addresses": [
784
+ {
785
+ "scope": "Link",
786
+ "prefixlen": "64",
787
+ "family": "inet6",
788
+ "address": "fe80::1"
789
+ },
790
+ {
791
+ "netmask": "255.0.0.0",
792
+ "family": "inet",
793
+ "address": "127.0.0.1"
794
+ },
795
+ {
796
+ "scope": "Node",
797
+ "prefixlen": "128",
798
+ "family": "inet6",
799
+ "address": "::1"
800
+ },
801
+ {
802
+ "scope": "Node",
803
+ "prefixlen": "128",
804
+ "family": "inet6",
805
+ "address": "private"
806
+ }
807
+ ],
808
+ "number": "0",
809
+ "mtu": "16384",
810
+ "type": "lo",
811
+ "encapsulation": "Loopback"
812
+ },
813
+ "vboxn": {
814
+ "counters": {
815
+ "tx": {
816
+ "bytes": "0",
817
+ "packets": "0",
818
+ "collisions": "0",
819
+ "compressed": 0,
820
+ "carrier": 0,
821
+ "drop": 0,
822
+ "errors": "0",
823
+ "overrun": 0
824
+ },
825
+ "rx": {
826
+ "bytes": "0",
827
+ "packets": "0",
828
+ "compressed": 0,
829
+ "drop": 0,
830
+ "errors": "0",
831
+ "overrun": 0,
832
+ "frame": 0,
833
+ "multicast": 0
834
+ }
835
+ }
836
+ },
837
+ "gif0": {
838
+ "flags": [
839
+ "POINTOPOINT",
840
+ "MULTICAST"
841
+ ],
842
+ "number": "0",
843
+ "mtu": "1280",
844
+ "type": "gif",
845
+ "encapsulation": "IPIP"
846
+ },
847
+ "vmnet": {
848
+ "counters": {
849
+ "tx": {
850
+ "bytes": "0",
851
+ "packets": "0",
852
+ "collisions": "0",
853
+ "compressed": 0,
854
+ "carrier": 0,
855
+ "drop": 0,
856
+ "errors": "0",
857
+ "overrun": 0
858
+ },
859
+ "rx": {
860
+ "bytes": "0",
861
+ "packets": "0",
862
+ "compressed": 0,
863
+ "drop": 0,
864
+ "errors": "0",
865
+ "overrun": 0,
866
+ "frame": 0,
867
+ "multicast": 0
868
+ }
869
+ }
870
+ },
871
+ "vmnet8": {
872
+ "flags": [
873
+ "UP",
874
+ "BROADCAST",
875
+ "SMART",
876
+ "RUNNING",
877
+ "SIMPLEX",
878
+ "MULTICAST"
879
+ ],
880
+ "addresses": [
881
+ {
882
+ "broadcast": "192.168.237.255",
883
+ "netmask": "255.255.255.0",
884
+ "family": "inet",
885
+ "address": "192.168.237.1"
886
+ },
887
+ {
888
+ "family": "lladdr",
889
+ "address": "private"
890
+ }
891
+ ],
892
+ "number": "8",
893
+ "mtu": "1500",
894
+ "type": "vmnet",
895
+ "encapsulation": "Ethernet"
896
+ },
897
+ "en0": {
898
+ "status": "inactive",
899
+ "flags": [
900
+ "UP",
901
+ "BROADCAST",
902
+ "SMART",
903
+ "RUNNING",
904
+ "SIMPLEX",
905
+ "MULTICAST"
906
+ ],
907
+ "addresses": [
908
+ {
909
+ "family": "lladdr",
910
+ "address": "private"
911
+ }
912
+ ],
913
+ "number": "0",
914
+ "mtu": "1500",
915
+ "media": {
916
+ "supported": [
917
+ {
918
+ "autoselect": {
919
+ "options": [
920
+
921
+ ]
922
+ }
923
+ },
924
+ {
925
+ "10baseT\/UTP": {
926
+ "options": [
927
+ "half-duplex"
928
+ ]
929
+ }
930
+ },
931
+ {
932
+ "10baseT\/UTP": {
933
+ "options": [
934
+ "full-duplex"
935
+ ]
936
+ }
937
+ },
938
+ {
939
+ "10baseT\/UTP": {
940
+ "options": [
941
+ "full-duplex",
942
+ "hw-loopback"
943
+ ]
944
+ }
945
+ },
946
+ {
947
+ "10baseT\/UTP": {
948
+ "options": [
949
+ "full-duplex",
950
+ "flow-control"
951
+ ]
952
+ }
953
+ },
954
+ {
955
+ "100baseTX": {
956
+ "options": [
957
+ "half-duplex"
958
+ ]
959
+ }
960
+ },
961
+ {
962
+ "100baseTX": {
963
+ "options": [
964
+ "full-duplex"
965
+ ]
966
+ }
967
+ },
968
+ {
969
+ "100baseTX": {
970
+ "options": [
971
+ "full-duplex",
972
+ "hw-loopback"
973
+ ]
974
+ }
975
+ },
976
+ {
977
+ "100baseTX": {
978
+ "options": [
979
+ "full-duplex",
980
+ "flow-control"
981
+ ]
982
+ }
983
+ },
984
+ {
985
+ "1000baseT": {
986
+ "options": [
987
+ "full-duplex"
988
+ ]
989
+ }
990
+ },
991
+ {
992
+ "1000baseT": {
993
+ "options": [
994
+ "full-duplex",
995
+ "hw-loopback"
996
+ ]
997
+ }
998
+ },
999
+ {
1000
+ "1000baseT": {
1001
+ "options": [
1002
+ "full-duplex",
1003
+ "flow-control"
1004
+ ]
1005
+ }
1006
+ },
1007
+ {
1008
+ "none": {
1009
+ "options": [
1010
+
1011
+ ]
1012
+ }
1013
+ }
1014
+ ],
1015
+ "selected": [
1016
+ {
1017
+ "autoselect": {
1018
+ "options": [
1019
+
1020
+ ]
1021
+ }
1022
+ }
1023
+ ]
1024
+ },
1025
+ "type": "en",
1026
+ "counters": {
1027
+ "tx": {
1028
+ "bytes": "342",
1029
+ "packets": "0",
1030
+ "collisions": "0",
1031
+ "compressed": 0,
1032
+ "carrier": 0,
1033
+ "drop": 0,
1034
+ "errors": "0",
1035
+ "overrun": 0
1036
+ },
1037
+ "rx": {
1038
+ "bytes": "0",
1039
+ "packets": "0",
1040
+ "compressed": 0,
1041
+ "drop": 0,
1042
+ "errors": "0",
1043
+ "overrun": 0,
1044
+ "frame": 0,
1045
+ "multicast": 0
1046
+ }
1047
+ },
1048
+ "encapsulation": "Ethernet"
1049
+ },
1050
+ "en1": {
1051
+ "status": "active",
1052
+ "flags": [
1053
+ "UP",
1054
+ "BROADCAST",
1055
+ "SMART",
1056
+ "RUNNING",
1057
+ "SIMPLEX",
1058
+ "MULTICAST"
1059
+ ],
1060
+ "addresses": [
1061
+ {
1062
+ "scope": "Link",
1063
+ "prefixlen": "64",
1064
+ "family": "inet6",
1065
+ "address": "private"
1066
+ },
1067
+ {
1068
+ "broadcast": "192.168.1.255",
1069
+ "netmask": "255.255.255.0",
1070
+ "family": "inet",
1071
+ "address": "192.168.1.4"
1072
+ },
1073
+ {
1074
+ "family": "lladdr",
1075
+ "address": "private"
1076
+ }
1077
+ ],
1078
+ "number": "1",
1079
+ "mtu": "1500",
1080
+ "media": {
1081
+ "supported": [
1082
+ {
1083
+ "autoselect": {
1084
+ "options": [
1085
+
1086
+ ]
1087
+ }
1088
+ }
1089
+ ],
1090
+ "selected": [
1091
+ {
1092
+ "autoselect": {
1093
+ "options": [
1094
+
1095
+ ]
1096
+ }
1097
+ }
1098
+ ]
1099
+ },
1100
+ "type": "en",
1101
+ "counters": {
1102
+ "tx": {
1103
+ "bytes": "449206298",
1104
+ "packets": "7041789",
1105
+ "collisions": "0",
1106
+ "compressed": 0,
1107
+ "carrier": 0,
1108
+ "drop": 0,
1109
+ "errors": "95",
1110
+ "overrun": 0
1111
+ },
1112
+ "rx": {
1113
+ "bytes": "13673879120",
1114
+ "packets": "19966002",
1115
+ "compressed": 0,
1116
+ "drop": 0,
1117
+ "errors": "1655893",
1118
+ "overrun": 0,
1119
+ "frame": 0,
1120
+ "multicast": 0
1121
+ }
1122
+ },
1123
+ "arp": {
1124
+ "192.168.1.7": "private"
1125
+ },
1126
+ "encapsulation": "Ethernet"
1127
+ },
1128
+ "fw0": {
1129
+ "status": "inactive",
1130
+ "flags": [
1131
+ "UP",
1132
+ "BROADCAST",
1133
+ "SMART",
1134
+ "RUNNING",
1135
+ "SIMPLEX",
1136
+ "MULTICAST"
1137
+ ],
1138
+ "addresses": [
1139
+ {
1140
+ "family": "lladdr",
1141
+ "address": "private"
1142
+ }
1143
+ ],
1144
+ "number": "0",
1145
+ "mtu": "4078",
1146
+ "media": {
1147
+ "supported": [
1148
+ {
1149
+ "autoselect": {
1150
+ "options": [
1151
+ "full-duplex"
1152
+ ]
1153
+ }
1154
+ }
1155
+ ],
1156
+ "selected": [
1157
+ {
1158
+ "autoselect": {
1159
+ "options": [
1160
+ "full-duplex"
1161
+ ]
1162
+ }
1163
+ }
1164
+ ]
1165
+ },
1166
+ "type": "fw",
1167
+ "counters": {
1168
+ "tx": {
1169
+ "bytes": "346",
1170
+ "packets": "0",
1171
+ "collisions": "0",
1172
+ "compressed": 0,
1173
+ "carrier": 0,
1174
+ "drop": 0,
1175
+ "errors": "0",
1176
+ "overrun": 0
1177
+ },
1178
+ "rx": {
1179
+ "bytes": "0",
1180
+ "packets": "0",
1181
+ "compressed": 0,
1182
+ "drop": 0,
1183
+ "errors": "0",
1184
+ "overrun": 0,
1185
+ "frame": 0,
1186
+ "multicast": 0
1187
+ }
1188
+ },
1189
+ "encapsulation": "1394"
1190
+ }
1191
+ }
1192
+ },
1193
+ "fqdn": "local.local",
1194
+ "ohai_time": 1240624355.08575,
1195
+ "domain": "local",
1196
+ "os": "darwin",
1197
+ "platform_build": "9G55",
1198
+ "os_version": "9.6.0",
1199
+ "hostname": "local",
1200
+ "macaddress": "private",
1201
+ "languages": {
1202
+ "ruby": {
1203
+ "target_os": "darwin9.0",
1204
+ "platform": "universal-darwin9.0",
1205
+ "host_vendor": "apple",
1206
+ "target_vendor": "apple",
1207
+ "target_cpu": "i686",
1208
+ "host_os": "darwin9.0",
1209
+ "host_cpu": "i686",
1210
+ "version": "1.8.6",
1211
+ "host": "i686-apple-darwin9.0",
1212
+ "target": "i686-apple-darwin9.0",
1213
+ "release_date": "2008-03-03"
1214
+ }
1215
+ }
1216
+ }