| Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/json/commit/15eb40dbdf
|
|
potentially uninitialized
https://github.com/ruby/json/commit/73818b80c8
|
|
https://github.com/ruby/json/commit/86a5cce405
|
|
https://github.com/ruby/json/commit/a51317c949
|
|
A plain `char` may be `signed` or `unsigned` depending on the
implementation. Also, bitwise ORing of `signed` values is not
guaranteed to be `signed`. To ensure portability, should logical-OR
each comparison, but casting to `signed char` is usually sufficient.
https://github.com/ruby/json/commit/8ad744c532
|
|
https://github.com/ruby/json/commit/976ba36629
Co-Authored-By: Jean Boussier <jean.boussier@gmail.com>
|
|
an extra memchr searching the remaining characters when no more backslashes exist.
https://github.com/ruby/json/commit/d21d9362fa
|
|
option
https://github.com/ruby/json/commit/a5c160f372
|
|
https://github.com/ruby/json/commit/4808fee9af
|
|
https://github.com/ruby/json/commit/1cdd2122d5
|
|
While it's not allowed by the spec, some parsers like Oj do
accept it, and it can be blocking a transition.
Having this feature can help people migrate.
https://github.com/ruby/json/commit/3459499cb3
|
|
It's the most likely control character so it's worth
giving a better error message for it.
https://github.com/ruby/json/commit/1da3fd9233
|
|
https://github.com/ruby/json/commit/e5e4fd558e
|
|
Fix: https://github.com/ruby/json/issues/912
In the case of surogate pairs we consume two backslashes, so
`json_next_backslash` need to ensure it's not sending us back in the
stream.
https://github.com/ruby/json/commit/0fce370c41
|
|
https://github.com/ruby/json/commit/4bdb2d14fe
|
|
https://github.com/ruby/json/commit/ccca602274
|
|
When serializing an Array, and one of the elements of the Array requires
calling `to_json`, if the depth is changed, it will be used for the next
entries, which wasn't the case before
https://github.com/ruby/json/commit/5abd43490714, and is not the case with
TruffleRuby and JRuby.
Additionally, with TruffleRuby and JRuby the state's depth after the
`to_json` call is used to close the Array, which isn't the case with
CRuby.
https://github.com/ruby/json/commit/386b36fde5
|
|
options as second argument
Otherwise it's very error prone.
https://github.com/ruby/json/commit/c54de70f90
|
|
`ALWAYS_INLINE()` and `NOINLINE()` are defined with one argument.
https://github.com/ruby/json/commit/8fb727901e
|
|
https://github.com/ruby/json/commit/9c36681b17
|
|
Now that the state isn't mutated in generate_new, we no longer need to
copy the struct, we can just use it.
https://github.com/ruby/json/commit/d7964f8892
|
|
For `JSON.generate` and `JSON::State#generate_new`, don't copy
generate_json_data::depth to JSON_Generator_State::depth.
In `JSON.generate`, the JSON_Generator_State is on the stack and
discarded anyway. In `JSON::State#generate_new`, we copy the struct to
avoid mutating the original one.
https://github.com/ruby/json/commit/873b29ea34
|
|
Instead of incrementing JSON_Generator_State::depth, we now increment
generate_json_data::depth, and only copied at the end.
https://github.com/ruby/json/commit/5abd434907
|
|
We can then pass them to the decoder to save having to parse
the string again.
```
== Parsing activitypub.json (58160 bytes)
ruby 3.4.6 (2025-09-16 revision https://github.com/ruby/json/commit/dbd83256b1) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
after 1.275k i/100ms
Calculating -------------------------------------
after 12.774k (± 0.8%) i/s (78.29 μs/i) - 65.025k in 5.090834s
Comparison:
before: 12314.3 i/s
after: 12773.8 i/s - 1.04x faster
== Parsing twitter.json (567916 bytes)
ruby 3.4.6 (2025-09-16 revision https://github.com/ruby/json/commit/dbd83256b1) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
after 143.000 i/100ms
Calculating -------------------------------------
after 1.441k (± 0.2%) i/s (693.86 μs/i) - 7.293k in 5.060345s
Comparison:
before: 1430.1 i/s
after: 1441.2 i/s - 1.01x faster
== Parsing citm_catalog.json (1727030 bytes)
ruby 3.4.6 (2025-09-16 revision https://github.com/ruby/json/commit/dbd83256b1) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
after 69.000 i/100ms
Calculating -------------------------------------
after 695.919 (± 0.4%) i/s (1.44 ms/i) - 3.519k in 5.056691s
Comparison:
before: 687.8 i/s
after: 695.9 i/s - 1.01x faster
```
https://github.com/ruby/json/commit/4f4551f993
|
|
Only `"\/bfnrtu` are valid after a backslash.
https://github.com/ruby/json/commit/f7f8f552ed
|
|
https://github.com/ruby/json/commit/256cad5def
|
|
https://github.com/ruby/json/commit/2a4ebe8250
|
|
https://github.com/ruby/json/commit/58d60d6b76
|
|
https://github.com/ruby/json/commit/9364d0c761
|
|
https://github.com/ruby/json/commit/ab5efca015
|
|
debugging code is not generated when JSON_DEBUG=0.
https://github.com/ruby/json/commit/4f1adb10d3
|
|
|
|
https://github.com/ruby/json/commit/5a12067f88
|
|
This prevent from freezing and sharing state instances.
If you needs some sort of arguments or extra state to the generator
methods, consider using `JSON::Coder` instead.
https://github.com/ruby/json/commit/e9fbc8937f
|
|
https://github.com/ruby/json/commit/826cb2a4f4
|
|
```
parser.c:87:77: error: missing binary operator before token "("
#if JSON_CPU_LITTLE_ENDIAN_64BITS && defined(__has_builtin) && __has_builtin(__builtin_bswap64)
```
https://github.com/ruby/json/commit/fce1c7e84a
|
|
Closes: https://github.com/ruby/json/pull/888
- Mark it as `inline`.
- Use `RSTRING_GETMEM`, instead of `RSTRING_LEN` and `RSTRING_PTR`.
- Use an inlinable version of `memcmp`.
```
== Parsing activitypub.json (58160 bytes)
ruby 3.4.6 (2025-09-16 revision https://github.com/ruby/json/commit/dbd83256b1) +YJIT +PRISM [arm64-darwin24]
Comparison:
before: 11766.6 i/s
after: 12272.1 i/s - 1.04x faster
== Parsing twitter.json (567916 bytes)
ruby 3.4.6 (2025-09-16 revision https://github.com/ruby/json/commit/dbd83256b1) +YJIT +PRISM [arm64-darwin24]
Comparison:
before: 1333.2 i/s
after: 1422.0 i/s - 1.07x faster
== Parsing citm_catalog.json (1727030 bytes)
ruby 3.4.6 (2025-09-16 revision https://github.com/ruby/json/commit/dbd83256b1) +YJIT +PRISM [arm64-darwin24]
Comparison:
before: 656.3 i/s
after: 673.1 i/s - 1.03x faster
== Parsing float parsing (2251051 bytes)
ruby 3.4.6 (2025-09-16 revision https://github.com/ruby/json/commit/dbd83256b1) +YJIT +PRISM [arm64-darwin24]
Comparison:
before: 276.8 i/s
after: 276.4 i/s - same-ish: difference falls within error
```
https://github.com/ruby/json/commit/a67d1a1af4
Co-Authored-By: Scott Myron <samyron@gmail.com>
|
|
Only apply these definitions on 64 bits archs, as it's unclear
if they have performance benefits or compatibility issues on
32bit archs.
https://github.com/ruby/json/commit/ddad00b746
|
|
https://github.com/ruby/json/commit/3bc1787bd4
|
|
Followup: https://github.com/ruby/json/pull/889
https://github.com/ruby/json/commit/591510392a
|
|
|
|
```
== Parsing activitypub.json (58160 bytes)
ruby 3.4.6 (2025-09-16 revision https://github.com/ruby/json/commit/dbd83256b1) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
after 1.174k i/100ms
Calculating -------------------------------------
after 11.756k (± 0.9%) i/s (85.06 μs/i) - 59.874k in 5.093438s
Comparison:
before: 11078.6 i/s
after: 11756.1 i/s - 1.06x faster
== Parsing twitter.json (567916 bytes)
ruby 3.4.6 (2025-09-16 revision https://github.com/ruby/json/commit/dbd83256b1) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
after 130.000 i/100ms
Calculating -------------------------------------
after 1.340k (± 0.3%) i/s (746.06 μs/i) - 6.760k in 5.043432s
Comparison:
before: 1191.1 i/s
after: 1340.4 i/s - 1.13x faster
== Parsing citm_catalog.json (1727030 bytes)
ruby 3.4.6 (2025-09-16 revision https://github.com/ruby/json/commit/dbd83256b1) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
after 68.000 i/100ms
Calculating -------------------------------------
after 689.451 (± 1.6%) i/s (1.45 ms/i) - 3.468k in 5.031470s
Comparison:
before: 630.3 i/s
after: 689.5 i/s - 1.09x faster
== Parsing float parsing (2251051 bytes)
ruby 3.4.6 (2025-09-16 revision https://github.com/ruby/json/commit/dbd83256b1) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
after 27.000 i/100ms
Calculating -------------------------------------
after 248.265 (± 0.8%) i/s (4.03 ms/i) - 1.242k in 5.003185s
Comparison:
before: 232.7 i/s
after: 248.3 i/s - 1.07x faster
```
https://github.com/ruby/json/commit/043880f6ab
Co-Authored-By: Scott Myron <samyron@gmail.com>
|
|
https://github.com/ruby/json/commit/21284ea649
|
|
We can share that logic between the two functions.
https://github.com/ruby/json/commit/ac580458e0
|
|
https://github.com/ruby/json/commit/31453b8e95
Co-Authored-By: Scott Myron <samyron@gmail.com>
|
|
`rstring_cache_fetch`
The caller already know if the string contains escape sequences
so this check is redundant.
Also stop calling `rstring_cache_fetch` from `json_string_unescape`
as we know it won't match anyways.
```
== Parsing twitter.json (567916 bytes)
ruby 3.4.6 (2025-09-16 revision https://github.com/ruby/json/commit/dbd83256b1) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
after 122.000 i/100ms
Calculating -------------------------------------
after 1.226k (± 0.3%) i/s (815.85 μs/i) - 6.222k in 5.076282s
Comparison:
before: 1206.2 i/s
after: 1225.7 i/s - 1.02x faster
```
https://github.com/ruby/json/commit/b8cdf3282d
Co-Authored-By: Scott Myron <samyron@gmail.com>
|
|
https://github.com/ruby/json/commit/1576ea7d47
|
|
Fix: https://github.com/ruby/json/issues/873
This allow users to encode binary strings if they so wish.
e.g. they can use Base64 or similar, or chose to replace invalid
characters with something else.
https://github.com/ruby/json/commit/b1b16c416f
|
|
https://github.com/ruby/json/commit/82b030f294
|
|
https://github.com/ruby/json/commit/3ea744ad67
|