json 2.11.2 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +13 -0
- data/ext/json/ext/generator/extconf.rb +29 -0
- data/ext/json/ext/generator/generator.c +446 -97
- data/ext/json/ext/generator/simd.h +112 -0
- data/ext/json/ext/parser/parser.c +131 -92
- data/ext/json/ext/vendor/fpconv.c +5 -5
- data/lib/json/common.rb +3 -1
- data/lib/json/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e71f977a9d4c1316007814d62236fd185f5aaade7a79f3e5d48a9ffde32f520
|
4
|
+
data.tar.gz: f1be8ac3136a6dcf48aa15c7ec08fa4dfcedb6f89b1b6ad8944727708a16e074
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23f2d490dfb7ea60b189f8227787fde0c53844f62c8e9023ba1d413a72b46b7a3b77836d1a6050dd0a2fa925370bd260da0a52d738bd1231c81ad1ef4a17adda
|
7
|
+
data.tar.gz: 22326ad3f75f99e20c7f1ad3cc0f519ffc56b7c85c94aa124a2ea47c8d0c86f604307fe504f216b347651d3c82df83623798dbdbabc45be78a1e4721cc7b8cbe
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
### Unreleased
|
4
|
+
|
5
|
+
### 2025-05-12 (2.12.0)
|
6
|
+
|
7
|
+
* Improve floating point generation to not use scientific notation as much.
|
8
|
+
* Include line and column in parser errors. Both in the message and as exception attributes.
|
9
|
+
* Handle non-string hash keys with broken `to_s` implementations.
|
10
|
+
* `JSON.generate` now uses SSE2 (x86) or NEON (arm64) instructions when available to escape strings.
|
11
|
+
|
12
|
+
### 2025-04-25 (2.11.3)
|
13
|
+
|
14
|
+
* Fix a regression in `JSON.pretty_generate` that could cause indentation to be off once some `#to_json` has been called.
|
15
|
+
|
3
16
|
### 2025-04-24 (2.11.2)
|
4
17
|
|
5
18
|
* Add back `JSON::PRETTY_STATE_PROTOTYPE`. This constant was private API but is used by popular gems like `multi_json`.
|
@@ -6,5 +6,34 @@ if RUBY_ENGINE == 'truffleruby'
|
|
6
6
|
else
|
7
7
|
append_cflags("-std=c99")
|
8
8
|
$defs << "-DJSON_GENERATOR"
|
9
|
+
|
10
|
+
if enable_config('generator-use-simd', default=!ENV["JSON_DISABLE_SIMD"])
|
11
|
+
if RbConfig::CONFIG['host_cpu'] =~ /^(arm.*|aarch64.*)/
|
12
|
+
# Try to compile a small program using NEON instructions
|
13
|
+
if have_header('arm_neon.h')
|
14
|
+
have_type('uint8x16_t', headers=['arm_neon.h']) && try_compile(<<~'SRC')
|
15
|
+
#include <arm_neon.h>
|
16
|
+
int main() {
|
17
|
+
uint8x16_t test = vdupq_n_u8(32);
|
18
|
+
return 0;
|
19
|
+
}
|
20
|
+
SRC
|
21
|
+
$defs.push("-DJSON_ENABLE_SIMD")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
if have_header('x86intrin.h') && have_type('__m128i', headers=['x86intrin.h']) && try_compile(<<~'SRC')
|
26
|
+
#include <x86intrin.h>
|
27
|
+
int main() {
|
28
|
+
__m128i test = _mm_set1_epi8(32);
|
29
|
+
return 0;
|
30
|
+
}
|
31
|
+
SRC
|
32
|
+
$defs.push("-DJSON_ENABLE_SIMD")
|
33
|
+
end
|
34
|
+
|
35
|
+
have_header('cpuid.h')
|
36
|
+
end
|
37
|
+
|
9
38
|
create_makefile 'json/ext/generator'
|
10
39
|
end
|