json 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of json might be problematic. Click here for more details.

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.rb +0 -221
  47. data/lib/json/add/core.rb +1 -1
  48. data/lib/json/editor.rb +11 -2
  49. data/lib/json/ext.rb +2 -0
  50. data/lib/json/pure.rb +2 -0
  51. data/lib/json/pure/generator.rb +77 -41
  52. data/lib/json/pure/parser.rb +6 -2
  53. data/lib/json/version.rb +1 -1
  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
@@ -122,19 +122,23 @@ module JSON
122
122
  def parse_string
123
123
  if scan(STRING)
124
124
  return '' if self[1].empty?
125
- self[1].gsub(%r((?:\\[\\bfnrt"/]|(?:\\u(?:[A-Fa-f\d]{4}))+|\\[\x20-\xff]))n) do |c|
125
+ string = self[1].gsub(%r((?:\\[\\bfnrt"/]|(?:\\u(?:[A-Fa-f\d]{4}))+|\\[\x20-\xff]))n) do |c|
126
126
  if u = UNESCAPE_MAP[$&[1]]
127
127
  u
128
128
  else # \uXXXX
129
129
  bytes = ''
130
130
  i = 0
131
- while c[6 * i] == ?\\ && c[6 * i + 1] == ?u
131
+ while c[6 * i] == ?\\ && c[6 * i + 1] == ?u
132
132
  bytes << c[6 * i + 2, 2].to_i(16) << c[6 * i + 4, 2].to_i(16)
133
133
  i += 1
134
134
  end
135
135
  JSON::UTF16toUTF8.iconv(bytes)
136
136
  end
137
137
  end
138
+ if string.respond_to?(:force_encoding)
139
+ string.force_encoding(Encoding::UTF_8)
140
+ end
141
+ string
138
142
  else
139
143
  UNPARSED
140
144
  end
@@ -1,6 +1,6 @@
1
1
  module JSON
2
2
  # JSON version
3
- VERSION = '1.1.3'
3
+ VERSION = '1.1.4'
4
4
  VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -1,14 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
2
3
 
3
4
  require 'test/unit'
4
- require 'json'
5
+ case ENV['JSON']
6
+ when 'pure' then require 'json/pure'
7
+ when 'ext' then require 'json/ext'
8
+ else require 'json'
9
+ end
5
10
  require 'stringio'
6
11
 
7
12
  class TC_JSON < Test::Unit::TestCase
8
13
  include JSON
9
14
 
10
15
  def setup
11
- $KCODE = 'UTF8'
12
16
  @ary = [1, "foo", 3.14, 4711.0, 2.718, nil, [1,-2,3], false, true].map do
13
17
  |x| [x]
14
18
  end
@@ -26,10 +30,9 @@ class TC_JSON < Test::Unit::TestCase
26
30
  'h' => 1000.0,
27
31
  'i' => 0.001
28
32
  }
29
- @json = '{"a":2,"b":3.141,"c":"c","d":[1,"b",3.14],"e":{"foo":"bar"},' +
33
+ @json = '{"a":2,"b":3.141,"c":"c","d":[1,"b",3.14],"e":{"foo":"bar"},'\
30
34
  '"g":"\\"\\u0000\\u001f","h":1.0E3,"i":1.0E-3}'
31
35
  end
32
- suite << TC_JSON.suite
33
36
 
34
37
  def test_construction
35
38
  parser = JSON::Parser.new('test')
@@ -1,6 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
+ # -*- coding:utf-8 -*-
2
3
 
3
4
  require 'test/unit'
5
+ case ENV['JSON']
6
+ when 'pure' then require 'json/pure'
7
+ when 'ext' then require 'json/ext'
8
+ else require 'json'
9
+ end
4
10
  require 'json/add/core'
5
11
  require 'date'
6
12
 
@@ -54,10 +60,6 @@ class TC_JSONAddition < Test::Unit::TestCase
54
60
  end
55
61
  end
56
62
 
57
- def setup
58
- $KCODE = 'UTF8'
59
- end
60
-
61
63
  def test_extended_json
62
64
  a = A.new(666)
63
65
  assert A.json_creatable?
@@ -98,6 +100,7 @@ class TC_JSONAddition < Test::Unit::TestCase
98
100
 
99
101
  def test_raw_strings
100
102
  raw = ''
103
+ raw.respond_to?(:encode!) and raw.encode!(Encoding::ASCII_8BIT)
101
104
  raw_array = []
102
105
  for i in 0..255
103
106
  raw << i
@@ -120,7 +123,7 @@ EOT
120
123
 
121
124
  def test_core
122
125
  t = Time.now
123
- assert_equal t, JSON(JSON(t))
126
+ assert_equal t.inspect, JSON(JSON(t)).inspect
124
127
  d = Date.today
125
128
  assert_equal d, JSON(JSON(d))
126
129
  d = DateTime.civil(2007, 6, 14, 14, 57, 10, Rational(1, 12), 2299161)
@@ -1,11 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
2
3
 
3
4
  require 'test/unit'
4
- require 'json'
5
+ case ENV['JSON']
6
+ when 'pure' then require 'json/pure'
7
+ when 'ext' then require 'json/ext'
8
+ else require 'json'
9
+ end
5
10
 
6
11
  class TC_JSONFixtures < Test::Unit::TestCase
7
12
  def setup
8
- $KCODE = 'UTF8'
9
13
  fixtures = File.join(File.dirname(__FILE__), 'fixtures/*.json')
10
14
  passed, failed = Dir[fixtures].partition { |f| f['pass'] }
11
15
  @passed = passed.inject([]) { |a, f| a << [ f, File.read(f) ] }.sort
@@ -1,11 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+
1
4
  require 'test/unit'
2
- require 'json'
5
+ case ENV['JSON']
6
+ when 'pure' then require 'json/pure'
7
+ when 'ext' then require 'json/ext'
8
+ else require 'json'
9
+ end
3
10
 
4
11
  class TC_JSONGenerate < Test::Unit::TestCase
5
12
  include JSON
6
13
 
7
14
  def setup
8
- $KCODE = 'UTF8'
9
15
  @hash = {
10
16
  'a' => 2,
11
17
  'b' => 3.141,
@@ -1,6 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
2
3
 
3
4
  require 'test/unit'
5
+ case ENV['JSON']
6
+ when 'pure' then require 'json/pure'
7
+ when 'ext' then require 'json/ext'
8
+ else require 'json'
9
+ end
4
10
  require 'json/add/rails'
5
11
  require 'date'
6
12
 
@@ -50,17 +56,38 @@ class TC_JSONRails < Test::Unit::TestCase
50
56
  end
51
57
  end
52
58
 
53
- def setup
54
- $KCODE = 'UTF8'
59
+ class D
60
+ def initialize
61
+ @foo = 666
62
+ end
63
+
64
+ attr_reader :foo
65
+
66
+ def ==(other)
67
+ foo == other.foo
68
+ end
55
69
  end
56
70
 
57
71
  def test_extended_json
58
72
  a = A.new(666)
59
73
  assert A.json_creatable?
74
+ assert_equal 666, a.a
60
75
  json = generate(a)
61
76
  a_again = JSON.parse(json)
62
77
  assert_kind_of a.class, a_again
63
78
  assert_equal a, a_again
79
+ assert_equal 666, a_again.a
80
+ end
81
+
82
+ def test_extended_json_generic_object
83
+ d = D.new
84
+ assert D.json_creatable?
85
+ assert_equal 666, d.foo
86
+ json = generate(d)
87
+ d_again = JSON.parse(json)
88
+ assert_kind_of d.class, d_again
89
+ assert_equal d, d_again
90
+ assert_equal 666, d_again.foo
64
91
  end
65
92
 
66
93
  def test_extended_json_disabled
@@ -94,6 +121,7 @@ class TC_JSONRails < Test::Unit::TestCase
94
121
 
95
122
  def test_raw_strings
96
123
  raw = ''
124
+ raw.respond_to?(:encode!) and raw.encode!(Encoding::ASCII_8BIT)
97
125
  raw_array = []
98
126
  for i in 0..255
99
127
  raw << i
@@ -1,15 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
2
3
 
3
4
  require 'test/unit'
4
- require 'json'
5
+ case ENV['JSON']
6
+ when 'pure' then require 'json/pure'
7
+ when 'ext' then require 'json/ext'
8
+ else require 'json'
9
+ end
5
10
 
6
11
  class TC_JSONUnicode < Test::Unit::TestCase
7
12
  include JSON
8
13
 
9
- def setup
10
- $KCODE = 'UTF8'
11
- end
12
-
13
14
  def test_unicode
14
15
  assert_equal '""', ''.to_json
15
16
  assert_equal '"\\b"', "\b".to_json
@@ -53,8 +54,8 @@ class TC_JSONUnicode < Test::Unit::TestCase
53
54
  assert_equal json, JSON.generate(["" << i])
54
55
  end
55
56
  end
56
- assert_raises(JSON::GeneratorError) do
57
- JSON.generate(["" << 0x80])
57
+ assert_raise(JSON::GeneratorError) do
58
+ JSON.generate(["\x80"])
58
59
  end
59
60
  assert_equal "\302\200", JSON.parse('["\u0080"]').first
60
61
  end
@@ -1,4 +1,3 @@
1
- $KCODE='UTF8'
2
1
  require 'json'
3
2
 
4
3
  require 'iconv'
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $KCODE='UTF8'
4
3
  require 'webrick'
5
4
  include WEBrick
6
5
  $:.unshift 'ext'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-07-11 00:00:00 +02:00
12
+ date: 2009-04-02 00:00:00 +02:00
13
13
  default_executable: edit_json.rb
14
14
  dependencies: []
15
15
 
@@ -102,17 +102,49 @@ files:
102
102
  - tests/fixtures/fail23.json
103
103
  - tests/fixtures/fail14.json
104
104
  - tests/fixtures/fail8.json
105
- - tests/runner.rb
106
105
  - tests/test_json_generate.rb
107
106
  - tests/test_json_rails.rb
108
107
  - tests/test_json_unicode.rb
109
108
  - tests/test_json_fixtures.rb
110
109
  - benchmarks
111
- - benchmarks/benchmark_parser.rb
112
- - benchmarks/benchmark_generator.rb
113
- - benchmarks/benchmark_rails.rb
114
- - benchmarks/benchmark.txt
110
+ - benchmarks/generator_benchmark.rb
111
+ - benchmarks/data-p4-3GHz-ruby18
112
+ - benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat
113
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat
114
+ - benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat
115
+ - benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat
116
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat
117
+ - benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat
118
+ - benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log
119
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat
120
+ - benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat
121
+ - benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat
122
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat
123
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log
124
+ - benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log
125
+ - benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log
126
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat
127
+ - benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log
128
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat
129
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat
130
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat
131
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat
132
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat
133
+ - benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat
134
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log
135
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log
136
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log
137
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat
138
+ - benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat
139
+ - benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log
140
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat
141
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat
142
+ - benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat
143
+ - benchmarks/data
144
+ - benchmarks/parser_benchmark.rb
115
145
  - Rakefile
146
+ - doc-templates
147
+ - doc-templates/main.txt
116
148
  - GPL
117
149
  - data
118
150
  - data/example.json
@@ -152,9 +184,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
184
  requirements: []
153
185
 
154
186
  rubyforge_project: json
155
- rubygems_version: 1.1.1
187
+ rubygems_version: 1.3.1
156
188
  signing_key:
157
189
  specification_version: 2
158
190
  summary: A JSON implementation as a Ruby extension
159
191
  test_files:
160
- - tests/runner.rb
192
+ - tests/test_json.rb
193
+ - tests/test_json_addition.rb
194
+ - tests/test_json_generate.rb
195
+ - tests/test_json_rails.rb
196
+ - tests/test_json_unicode.rb
197
+ - tests/test_json_fixtures.rb
@@ -1,133 +0,0 @@
1
- (in /home/flori/json)
2
- Ragel Code Generator version 5.17 January 2007
3
- Copyright (c) 2001-2006 by Adrian Thurston
4
- Benchmarking extension variant
5
- First run for warmup.
6
- Running 'BC_Parser' for a duration of 10 secs per method:
7
- real total utime stime cutime cstime
8
- parser: 10.005944 10.010000 9.970000 0.040000 0.000000 0.000000
9
- 5091 508.591409 0.001966
10
- calls calls/sec secs/call
11
- --------------------------------------------------------------------------------
12
- Running 'BC_Parser' for a duration of 10 secs per method:
13
- real total utime stime cutime cstime
14
- parser: 10.006881 10.000000 9.950000 0.050000 0.000000 0.000000
15
- 5055 505.500000 0.001978
16
- calls calls/sec secs/call
17
- --------------------------------------------------------------------------------
18
- ================================================================================
19
-
20
-
21
- [null,false,true,"f\u00d6\u00df\u00c4r",["n\u20acst\u20acd",true],{"quux":true,"foo\u00df":"b\u00e4r"}]
22
- First run for warmup.
23
- Running 'BC_Generator' for a duration of 10 secs per method:
24
- real total utime stime cutime cstime
25
- generator_pretty: 10.001066 10.010000 9.990000 0.020000 0.000000 0.000000
26
- 3492 348.851149 0.002867
27
- generator_fast : 10.002910 10.000000 9.980000 0.020000 0.000000 0.000000
28
- 5416 541.600000 0.001846
29
- generator_safe : 10.003107 10.010000 10.000000 0.010000 0.000000 0.000000
30
- 4926 492.107892 0.002032
31
- calls calls/sec secs/call
32
- --------------------------------------------------------------------------------
33
- Running 'BC_Generator' for a duration of 10 secs per method:
34
- real total utime stime cutime cstime
35
- generator_pretty: 10.009150 10.010000 10.010000 0.000000 0.000000 0.000000
36
- 3511 350.749251 0.002851
37
- generator_fast : 10.014407 10.020000 10.020000 0.000000 0.000000 0.000000
38
- 5411 540.019960 0.001852
39
- generator_safe : 10.010055 10.000000 10.000000 0.000000 0.000000 0.000000
40
- 4933 493.300000 0.002027
41
- calls calls/sec secs/call
42
- --------------------------------------------------------------------------------
43
- ================================================================================
44
-
45
- Comparison in BC_Generator:
46
- secs/call speed
47
- generator_fast : 0.002 -> 1.540x
48
- generator_safe : 0.002 -> 1.406x
49
- generator_pretty: 0.003 -> 1.000x
50
- --------------------------------------------------------------------------------
51
-
52
- [null, false, true, "f\u00d6\u00df\u00c4r", ["n\u20acst\u20acd", true], {quux: true, "foo\u00df": "b\u00e4r"}]
53
- First run for warmup.
54
- Running 'BC_Rails' for a duration of 10 secs per method:
55
- real total utime stime cutime cstime
56
- generator: 10.026043 10.020000 10.020000 0.000000 0.000000 0.000000
57
- 239 23.852295 0.041925
58
- calls calls/sec secs/call
59
- --------------------------------------------------------------------------------
60
- Running 'BC_Rails' for a duration of 10 secs per method:
61
- real total utime stime cutime cstime
62
- generator: 10.010931 10.020000 10.010000 0.010000 0.000000 0.000000
63
- 238 23.752495 0.042101
64
- calls calls/sec secs/call
65
- --------------------------------------------------------------------------------
66
- ================================================================================
67
-
68
-
69
- Benchmarking pure variant
70
- First run for warmup.
71
- Running 'BC_Parser' for a duration of 10 secs per method:
72
- real total utime stime cutime cstime
73
- parser: 10.022352 10.030000 10.020000 0.010000 0.000000 0.000000
74
- 288 28.713858 0.034826
75
- calls calls/sec secs/call
76
- --------------------------------------------------------------------------------
77
- Running 'BC_Parser' for a duration of 10 secs per method:
78
- real total utime stime cutime cstime
79
- parser: 10.006552 10.000000 10.000000 0.000000 0.000000 0.000000
80
- 289 28.900000 0.034602
81
- calls calls/sec secs/call
82
- --------------------------------------------------------------------------------
83
- ================================================================================
84
-
85
-
86
- [null,false,true,"f\u00d6\u00df\u00c4r",["n\u20acst\u20acd",true],{"quux":true,"foo\u00df":"b\u00e4r"}]
87
- First run for warmup.
88
- Running 'BC_Generator' for a duration of 10 secs per method:
89
- real total utime stime cutime cstime
90
- generator_fast : 10.011644 10.010000 10.010000 0.000000 0.000000 0.000000
91
- 411 41.058941 0.024355
92
- generator_safe : 10.007100 10.010000 10.010000 0.000000 0.000000 0.000000
93
- 352 35.164835 0.028438
94
- generator_pretty: 10.008156 10.010000 10.010000 0.000000 0.000000 0.000000
95
- 341 34.065934 0.029355
96
- calls calls/sec secs/call
97
- --------------------------------------------------------------------------------
98
- Running 'BC_Generator' for a duration of 10 secs per method:
99
- real total utime stime cutime cstime
100
- generator_fast : 10.005185 10.010000 10.010000 0.000000 0.000000 0.000000
101
- 411 41.058941 0.024355
102
- generator_safe : 10.006932 10.010000 10.010000 0.000000 0.000000 0.000000
103
- 351 35.064935 0.028519
104
- generator_pretty: 10.007414 10.000000 10.000000 0.000000 0.000000 0.000000
105
- 340 34.000000 0.029412
106
- calls calls/sec secs/call
107
- --------------------------------------------------------------------------------
108
- ================================================================================
109
-
110
- Comparison in BC_Generator:
111
- secs/call speed
112
- generator_fast : 0.024 -> 1.208x
113
- generator_safe : 0.029 -> 1.031x
114
- generator_pretty: 0.029 -> 1.000x
115
- --------------------------------------------------------------------------------
116
-
117
- [null, false, true, "f\u00d6\u00df\u00c4r", ["n\u20acst\u20acd", true], {quux: true, "foo\u00df": "b\u00e4r"}]
118
- First run for warmup.
119
- Running 'BC_Rails' for a duration of 10 secs per method:
120
- real total utime stime cutime cstime
121
- generator: 10.005748 10.000000 10.000000 0.000000 0.000000 0.000000
122
- 240 24.000000 0.041667
123
- calls calls/sec secs/call
124
- --------------------------------------------------------------------------------
125
- Running 'BC_Rails' for a duration of 10 secs per method:
126
- real total utime stime cutime cstime
127
- generator: 10.006764 10.010000 10.010000 0.000000 0.000000 0.000000
128
- 239 23.876124 0.041883
129
- calls calls/sec secs/call
130
- --------------------------------------------------------------------------------
131
- ================================================================================
132
-
133
-