<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/ext/json/parser/parser.c, branch v3_2_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[flori/json] Stop including the parser source __LINE__ in exceptions</title>
<updated>2022-07-29T10:10:10+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2021-05-20T10:40:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=66b52f046f3e4c5d24781a142f9633e07c42d6d9'/>
<id>66b52f046f3e4c5d24781a142f9633e07c42d6d9</id>
<content type='text'>
It makes testing for JSON errors very tedious. You either have
to use a Regexp or to regularly update all your assertions
when JSON is upgraded.

https://github.com/flori/json/commit/de9eb1d28e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It makes testing for JSON errors very tedious. You either have
to use a Regexp or to regularly update all your assertions
when JSON is upgraded.

https://github.com/flori/json/commit/de9eb1d28e
</pre>
</div>
</content>
</entry>
<entry>
<title>[flori/json] Fix parser bug for empty string allocation</title>
<updated>2022-05-20T08:49:13+00:00</updated>
<author>
<name>Andrew Bromwich</name>
<email>a.bromwich@gmail.com</email>
</author>
<published>2022-04-20T12:30:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a15d0e267a8a429cf2a2a4358080666ee2260526'/>
<id>a15d0e267a8a429cf2a2a4358080666ee2260526</id>
<content type='text'>
When `HAVE_RB_ENC_INTERNED_STR` is enabled it is possible to
pass through a null pointer to `rb_enc_interned_str` resulting
in a segfault

Fixes #495

https://github.com/flori/json/commit/b59368a8c2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When `HAVE_RB_ENC_INTERNED_STR` is enabled it is possible to
pass through a null pointer to `rb_enc_interned_str` resulting
in a segfault

Fixes #495

https://github.com/flori/json/commit/b59368a8c2
</pre>
</div>
</content>
</entry>
<entry>
<title>[flori/json] Doc: Improve documentation on JSON#parse and JSON#parse!</title>
<updated>2022-05-20T08:49:13+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2021-12-02T07:42:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=767f3904ee2a15575c292d89578de7669f169346'/>
<id>767f3904ee2a15575c292d89578de7669f169346</id>
<content type='text'>
https://github.com/flori/json/commit/75ada77b96

Co-authored-by: Bruno Gomes da Silva &lt;brunojabs@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/flori/json/commit/75ada77b96

Co-authored-by: Bruno Gomes da Silva &lt;brunojabs@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext/json/parser/prereq.mk: fix warnings for code generated by ragel</title>
<updated>2021-05-18T14:26:03+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-05-18T02:48:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7c716b686ca396733028f9a824f8cd656e23f7a2'/>
<id>7c716b686ca396733028f9a824f8cd656e23f7a2</id>
<content type='text'>
* type-limits when plain-char is unsigned
* unused-const-variable for NFA constants
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* type-limits when plain-char is unsigned
* unused-const-variable for NFA constants
</pre>
</div>
</content>
</entry>
<entry>
<title>[flori/json] Deduplicate strings inside json_string_unescape</title>
<updated>2021-05-17T10:51:51+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2020-11-18T10:59:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2de594ca98d95e62f7fcf000f21e174ac3f6fcaf'/>
<id>2de594ca98d95e62f7fcf000f21e174ac3f6fcaf</id>
<content type='text'>
[ci 2]

https://github.com/flori/json/commit/1982070cb8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ci 2]

https://github.com/flori/json/commit/1982070cb8
</pre>
</div>
</content>
</entry>
<entry>
<title>[flori/json] Refactor json_string_unescape</title>
<updated>2021-05-17T10:51:50+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2020-11-18T10:33:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1d2b4ccaf28596efee65c59dc69ea489a4237079'/>
<id>1d2b4ccaf28596efee65c59dc69ea489a4237079</id>
<content type='text'>
https://github.com/flori/json/commit/f398769332
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/flori/json/commit/f398769332
</pre>
</div>
</content>
</entry>
<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>
</feed>
