| Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/json/commit/9c4db31908
Co-Authored-By: Jean Boussier <jean.boussier@gmail.com>
|
|
https://github.com/ruby/json/commit/965ba6c5d4
|
|
https://github.com/ruby/json/commit/f228b30635
|
|
https://github.com/ruby/json/commit/1ba1e9bef9
|
|
https://github.com/ruby/json/commit/5e61cd7dce
|
|
Fix: https://github.com/rails/rails/commit/90616277e3d8fc46c9cf35d6a7470ff1ea0092f7#r168784389
Because the `depth` counter is inside `JSON::State` it can't be used
concurrently, and in case of a circular reference the counter may be
left at the max value.
The depth counter should be moved outside `JSON_Generator_State` and
into `struct generate_json_data`, but it's a larger refactor.
In the meantime, `JSON::Coder` calls `State#generate_new` so I changed
that method so that it first copy the state on the stack.
https://github.com/ruby/json/commit/aefa671eca
|
|
https://github.com/ruby/json/commit/9e6067bb55
|
|
https://github.com/ruby/json/commit/4abfad090d
|
|
e.g.
```ruby
{ 1 => 2 }
```
The callback will be invoked for `1` as while it has a native JSON
equivalent, it's not legal as an object name.
|
|
Fix: https://github.com/ruby/json/issues/861
It's not incorrect to use scientific notation, but it tend
to throw people off a bit, so it's best to keep it for very large
numbers.
https://github.com/ruby/json/commit/1566cd01a6
|
|
https://github.com/ruby/json/commit/51ce76ea66
|
|
https://github.com/ruby/json/commit/55552cafe2
|
|
https://github.com/ruby/json/commit/5855f4f603
|
|
https://github.com/ruby/json/commit/3232e8df41
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
The gem root was including the test/ directory, so lines from tests were
skipped, and the deprecation warnings were shown as coming from the test
framework.
https://github.com/ruby/json/commit/2ec31a7363
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
Fix https://github.com/ruby/json/commit/f411ddf1ceaf
https://github.com/ruby/json/commit/1397bf8cc9
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
the correct use of proc argument.
https://github.com/ruby/json/commit/92654cd99b
|
|
when passing proc to JSON.unsafe_load, matching the changes made in
https://github.com/ruby/json/commit/73d2137fd3ad.
https://github.com/ruby/json/commit/77292cbc9b
|
|
Fix: https://github.com/ruby/json/pull/843
https://github.com/ruby/json/commit/d3f7f0452b
Co-Authored-By: Takashi Kokubun <takashikkbn@gmail.com>
|
|
Because both strings and symbols keys are serialized the same,
it always has been possible to generate documents with duplicated
keys:
```ruby
>> puts JSON.generate({ foo: 1, "foo" => 2 })
{"foo":1,"foo":2}
```
This is pretty much always a mistake and can cause various
issues because it's not guaranteed how various JSON parsers
will handle this.
Until now I didn't think it was possible to catch such case without
tanking performance, hence why I only made the parser more strict.
But I finally found a way to check for duplicated keys cheaply enough.
|
|
|
|
|
|
https://github.com/ruby/json/commit/3187c88c06
|
|
https://github.com/ruby/json/commit/19bcfdd8d8
|
|
Helps with pretty printting performance:
```
== Encoding activitypub.json (52595 bytes)
ruby 3.4.2 (2025-02-15 revision https://github.com/ruby/json/commit/d2930f8e7a) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
after 1.746k i/100ms
Calculating -------------------------------------
after 17.481k (± 1.0%) i/s (57.20 μs/i) - 89.046k in 5.094341s
Comparison:
before: 16038.4 i/s
after: 17481.1 i/s - 1.09x faster
== Encoding citm_catalog.json (500298 bytes)
ruby 3.4.2 (2025-02-15 revision https://github.com/ruby/json/commit/d2930f8e7a) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
after 60.000 i/100ms
Calculating -------------------------------------
after 608.157 (± 2.3%) i/s (1.64 ms/i) - 3.060k in 5.034238s
Comparison:
before: 525.3 i/s
after: 608.2 i/s - 1.16x faster
== Encoding twitter.json (466906 bytes)
ruby 3.4.2 (2025-02-15 revision https://github.com/ruby/json/commit/d2930f8e7a) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
after 160.000 i/100ms
Calculating -------------------------------------
after 1.606k (± 0.5%) i/s (622.70 μs/i) - 8.160k in 5.081406s
Comparison:
before: 1410.3 i/s
after: 1605.9 i/s - 1.14x faster
```
https://github.com/ruby/json/commit/f0dda861c5
|
|
https://github.com/ruby/json/commit/2d63648c0a
|
|
https://github.com/ruby/json/commit/12656777dc
|
|
|
|
https://github.com/ruby/json/commit/72e231f929
|
|
https://github.com/ruby/json/commit/2d2e0d403d
|
|
All the `json/add` related methods for string were
always defined unconditionally from the generators.
It's preferable to only define them if `json/add` is actually used.
|
|
https://github.com/ruby/json/commit/9e3efbfa22
|
|
https://github.com/ruby/json/commit/132049bde2
|
|
Followup: https://github.com/ruby/json/pull/818
Now the warning should point at the `JSON.parse` caller, and not
inside the json gem itself.
https://github.com/ruby/json/commit/cd51557387
|
|
Followup: https://github.com/ruby/json/pull/818
https://github.com/ruby/json/commit/e3de4cc59c
|
|
https://github.com/ruby/json/commit/1988a3ae4c
|
|
If `load_uint8x16_4` has an external linkage, it is defined in
both `generator` and `parser` extension libraries. This duplicate
symbol causes a linker error when `--with-static-linked-ext` is
given, on some platforms.
https://github.com/ruby/json/commit/020693b17a
|
|
https://github.com/ruby/json/commit/cfe9337eda
|
|
Fix: https://github.com/ruby/json/issues/827
On very old compilers it might not exist, at that point
might as well skip SIMD entirely.
https://github.com/ruby/json/commit/da878435dc
|
|
Found by wbcheck
WBCHECK ERROR: Missed write barrier detected!
Parent object: 0x7b7b8487c450 (wb_protected: true)
rb_obj_info_dump: 0x00007b7b8487c450 JSON/Generator/State/JSON::Ext::Generator::State JSON/Generator/State
Reference counts - snapshot: 1, writebarrier: 0, current: 6, missed: 5
Missing reference to: 0x7b7b82f35a10
rb_obj_info_dump: 0x00007b7b82f35a10 T_STRING/String len: 1, capa: 15 "1"
Missing reference to: 0x7b7b82f35e90
rb_obj_info_dump: 0x00007b7b82f35e90 T_STRING/String len: 1, capa: 15 "2"
Missing reference to: 0x7b7b83629e50
rb_obj_info_dump: 0x00007b7b83629e50 T_STRING/String len: 1, capa: 15 "3"
Missing reference to: 0x7b7b83b62190
rb_obj_info_dump: 0x00007b7b83b62190 T_STRING/String len: 1, capa: 15 "4"
Missing reference to: 0x7b7b83629490
rb_obj_info_dump: 0x00007b7b83629490 T_STRING/String len: 1, capa: 15 "5"
https://github.com/ruby/json/commit/c24342d801
|
|
https://github.com/ruby/json/commit/8d08494dee
|
|
|
|
https://github.com/ruby/json/commit/a497c71960
|
|
https://github.com/ruby/json/commit/95fb084027
|
|
It's only needed if using GCC `ifunc` mecanism, which
we don't.
https://github.com/ruby/json/commit/d3317b9f82
|
|
https://github.com/ruby/json/commit/94ed471814
|
|
Integrate duplicate code by extracting headers, types and
initialization code.
https://github.com/ruby/json/commit/1a768d9179
|
|
Remove `have_type` calls because the next `try_compile` calls check
those types.
https://github.com/ruby/json/commit/b08e1ca2c1
|
|
See the results of `have_type` and `try_compile` in addition to
`have_header` for NEON as well as x86_64. The former results were
just ignored, and `HAVE_TYPE_` macros are unused too.
https://github.com/ruby/json/commit/fdbb6062c2
|
|
Align code for arm and x86_64 in parallel.
https://github.com/ruby/json/commit/2211e30a59
|