ruby/ext/json
Jean Boussier f756950d82
Improve lookup tables for string escaping.
Introduce a simplified table for the most common case, which is
`script_safe: false, ascii_only: false`.

On the `script_safe` table, now only `0xE2` does a multi-byte check.

Merge back `convert_ASCII_to_JSON`, as it no longer help much with
the simplified escape table.

```
== Encoding mixed utf8 (5003001 bytes)
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [arm64-darwin23]
Warming up --------------------------------------
               after    38.000 i/100ms
Calculating -------------------------------------
               after    398.220 (± 3.0%) i/s    (2.51 ms/i) -      2.014k in   5.061659s

Comparison:
              before:      381.8 i/s
               after:      398.2 i/s - same-ish: difference falls within error

== Encoding mostly utf8 (5001001 bytes)
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [arm64-darwin23]
Warming up --------------------------------------
               after    39.000 i/100ms
Calculating -------------------------------------
               after    393.337 (± 2.5%) i/s    (2.54 ms/i) -      1.989k in   5.059397s

Comparison:
              before:      304.3 i/s
               after:      393.3 i/s - 1.29x  faster

== Encoding twitter.json (466906 bytes)
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [arm64-darwin23]
Warming up --------------------------------------
               after   244.000 i/100ms
Calculating -------------------------------------
               after      2.436k (± 0.9%) i/s  (410.43 μs/i) -     12.200k in   5.007702s

Comparison:
              before:     2125.9 i/s
               after:     2436.5 i/s - 1.15x  faster
```
2025-01-07 13:21:46 +09:00
..
fbuffer [ruby/json] JSON.dump: write directly into the provided IO 2024-11-26 15:11:05 +09:00
generator Improve lookup tables for string escaping. 2025-01-07 13:21:46 +09:00
lib [ruby/json] Release 2.9.1 2024-12-19 08:45:31 +09:00
parser [ruby/json] Add support for Solaris 10 which lacks strnlen() 2024-12-19 08:45:31 +09:00
depend Added depend files 2019-07-14 01:31:29 +09:00
extconf.rb Restore ext/json/extconf.rb 2024-10-26 18:44:15 +09:00
json.gemspec [ruby/json] Fix gemspec to include .jar files 2024-11-11 09:40:08 +09:00