<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/ext/json/parser/parser.rl, branch v3_0_4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[json] Make json Ractor safe</title>
<updated>2020-12-21T13:10:43+00:00</updated>
<author>
<name>Kenta Murata</name>
<email>mrkn@mrkn.jp</email>
</author>
<published>2020-12-21T06:57:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=14d7d1df25bbefadfc385042d541b4afc31e4c1b'/>
<id>14d7d1df25bbefadfc385042d541b4afc31e4c1b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[json] JSON_parse_float: Fix how to convert number</title>
<updated>2020-12-21T13:10:43+00:00</updated>
<author>
<name>Kenta Murata</name>
<email>mrkn@mrkn.jp</email>
</author>
<published>2020-12-21T06:50:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4c2e7f26bda8df087a66e546744de0d0d467ea7c'/>
<id>4c2e7f26bda8df087a66e546744de0d0d467ea7c</id>
<content type='text'>
Stop BigDecimal-specific optimization.  Instead, it tries the conversion
methods in the following order:

1. `try_convert`,
2. `new`, and
3. class-named function, e.g. `Foo::Bar.Baz` function for `Foo::Bar::Baz` class

If all the above candidates are unavailable, it fallbacks to Float.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Stop BigDecimal-specific optimization.  Instead, it tries the conversion
methods in the following order:

1. `try_convert`,
2. `new`, and
3. class-named function, e.g. `Foo::Bar.Baz` function for `Foo::Bar::Baz` class

If all the above candidates are unavailable, it fallbacks to Float.
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement a freeze: parser option</title>
<updated>2020-10-20T12:40:25+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2020-09-09T13:24:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=520e0916af0fe53a5ca57269a2bae50cc60e4241'/>
<id>520e0916af0fe53a5ca57269a2bae50cc60e4241</id>
<content type='text'>
If set to true all parsed objects will be
immediately frozen, and strings will be
deduplicated if the Ruby implementation
allows it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If set to true all parsed objects will be
immediately frozen, and strings will be
deduplicated if the Ruby implementation
allows it.
</pre>
</div>
</content>
</entry>
<entry>
<title>[flori/json] Use frozen string for hash key</title>
<updated>2020-07-01T09:47:51+00:00</updated>
<author>
<name>Watson</name>
<email>watson1978@gmail.com</email>
</author>
<published>2018-02-27T13:40:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cb3e62511c7c7a7d568342d82b641e491ce589e1'/>
<id>cb3e62511c7c7a7d568342d82b641e491ce589e1</id>
<content type='text'>
When use non-frozen string for hash key with `rb_hash_aset()`, it will duplicate and freeze it internally.
To avoid duplicate and freeze, this patch will give a frozen string in `rb_hash_aset()`.

```
Warming up --------------------------------------
                json    14.000  i/100ms
Calculating -------------------------------------
                json    148.844  (± 1.3%) i/s -    756.000  in   5.079969s
```

```
Warming up --------------------------------------
                json    16.000  i/100ms
Calculating -------------------------------------
                json    165.608  (± 1.8%) i/s -    832.000  in   5.025367s
```

```
require 'json'
require 'securerandom'
require 'benchmark/ips'

obj = []

1000.times do |i|
  obj &lt;&lt; {
    "id": i,
    "uuid": SecureRandom.uuid,
    "created_at": Time.now
  }
end

json = obj.to_json

Benchmark.ips do |x|
  x.report "json" do |iter|
    count = 0
    while count &lt; iter
      JSON.parse(json)
      count += 1
    end
  end
end
```

https://github.com/flori/json/commit/18292c0c1d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When use non-frozen string for hash key with `rb_hash_aset()`, it will duplicate and freeze it internally.
To avoid duplicate and freeze, this patch will give a frozen string in `rb_hash_aset()`.

```
Warming up --------------------------------------
                json    14.000  i/100ms
Calculating -------------------------------------
                json    148.844  (± 1.3%) i/s -    756.000  in   5.079969s
```

```
Warming up --------------------------------------
                json    16.000  i/100ms
Calculating -------------------------------------
                json    165.608  (± 1.8%) i/s -    832.000  in   5.025367s
```

```
require 'json'
require 'securerandom'
require 'benchmark/ips'

obj = []

1000.times do |i|
  obj &lt;&lt; {
    "id": i,
    "uuid": SecureRandom.uuid,
    "created_at": Time.now
  }
end

json = obj.to_json

Benchmark.ips do |x|
  x.report "json" do |iter|
    count = 0
    while count &lt; iter
      JSON.parse(json)
      count += 1
    end
  end
end
```

https://github.com/flori/json/commit/18292c0c1d
</pre>
</div>
</content>
</entry>
<entry>
<title>[flori/json] Only attempt to resize strings not other objects</title>
<updated>2019-10-14T10:54:48+00:00</updated>
<author>
<name>Florian Frank</name>
<email>flori@ping.de</email>
</author>
<published>2019-04-29T13:56:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7376d70cb0817158a9ce0ef433872be5ca7af56b'/>
<id>7376d70cb0817158a9ce0ef433872be5ca7af56b</id>
<content type='text'>
https://github.com/flori/json/commit/167ada8da7
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/flori/json/commit/167ada8da7
</pre>
</div>
</content>
</entry>
<entry>
<title>ext/json/parser/parser.rl: Use "signed" char to contain negative values</title>
<updated>2019-10-04T22:00:57+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2019-10-04T22:00:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=417c64b9a8c4815a54f9bbef37f4438ee5c2f4fc'/>
<id>417c64b9a8c4815a54f9bbef37f4438ee5c2f4fc</id>
<content type='text'>
char is not always signed.  In fact, it is unsigned in arm.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-master/log/20191004T181708Z.log.html.gz
```
compiling parser.c
parser.rl: In function ‘unescape_unicode’:
parser.rl:50:5: warning: comparison is always false due to limited range of data type [-Wtype-limits]
     if (b &lt; 0) return UNI_REPLACEMENT_CHAR;
     ^
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
char is not always signed.  In fact, it is unsigned in arm.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-master/log/20191004T181708Z.log.html.gz
```
compiling parser.c
parser.rl: In function ‘unescape_unicode’:
parser.rl:50:5: warning: comparison is always false due to limited range of data type [-Wtype-limits]
     if (b &lt; 0) return UNI_REPLACEMENT_CHAR;
     ^
```
</pre>
</div>
</content>
</entry>
<entry>
<title>ext/json/parser/parser.rl: Update the source code of parser.c</title>
<updated>2019-10-04T21:34:40+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2019-10-04T21:30:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=076d3d758b0df47d3dceb3ba0930486f3dd0cc2d'/>
<id>076d3d758b0df47d3dceb3ba0930486f3dd0cc2d</id>
<content type='text'>
There have been some direct changes in parser.c which is automatically
generated from parser.rl.  This updates parser.rl to sync the changes:

* 91793b8967e0531bd1159a8ff0cc7e50739c7620
* 79ead821dd4880725c9c6bb9645b3fad71715c5b
* 80b5a0ff2a7709367178f29d4ebe1c54122b1c27
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There have been some direct changes in parser.c which is automatically
generated from parser.rl.  This updates parser.rl to sync the changes:

* 91793b8967e0531bd1159a8ff0cc7e50739c7620
* 79ead821dd4880725c9c6bb9645b3fad71715c5b
* 80b5a0ff2a7709367178f29d4ebe1c54122b1c27
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix JSON::Parser against bigdecimal updates</title>
<updated>2018-12-02T05:21:57+00:00</updated>
<author>
<name>mrkn</name>
<email>mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-12-02T05:21:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a7e3516ff1116a15b3ed62f55143eceee27c4ce9'/>
<id>a7e3516ff1116a15b3ed62f55143eceee27c4ce9</id>
<content type='text'>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>ext/json/parser/parser.c: do not call rb_str_resize() on Time object</title>
<updated>2018-08-03T15:11:36+00:00</updated>
<author>
<name>eregon</name>
<email>eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-08-03T15:11:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e7da0fc34e8ed7fa250fc38f1109e4944cbad808'/>
<id>e7da0fc34e8ed7fa250fc38f1109e4944cbad808</id>
<content type='text'>
* See https://github.com/flori/json/issues/342

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* See https://github.com/flori/json/issues/342

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix missed update of parser source in r62429</title>
<updated>2018-08-03T15:11:22+00:00</updated>
<author>
<name>eregon</name>
<email>eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-08-03T15:11:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bf226a9ac40e2296589004be89b4420b2121e000'/>
<id>bf226a9ac40e2296589004be89b4420b2121e000</id>
<content type='text'>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
</feed>
