nosj 0.3.2-x86_64-linux → 0.4.0-x86_64-linux

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebfb1f3235c863a322c75dcbfa3b7ea1514787d3d20ec4aac4dcee4df7fc4288
4
- data.tar.gz: 75141c5cd1f8aeed9c637895d70a390ea8a50f6839223a24f5a9845c29b6a173
3
+ metadata.gz: effa3ad5689bc6b7db21ff87769eb797fb7a5930ed8859b4ff7537e70a8301f4
4
+ data.tar.gz: 3c0d90a1732b7ec4db785a91754cea7bb0eb2cd97802eaeb3b3018ea45c0e884
5
5
  SHA512:
6
- metadata.gz: 276f5b7c940d0472c1aa6be96a36291a06c30732a39b1b6410625a4194e5803731c0c89823ea076df7c4e0505b5e7944f614ae135039b3cd73bcc8ee9a5ebe8e
7
- data.tar.gz: 56c66d7600e92632d5f310bc01ecb8e8d3416c38be081f128b09949d58927fc03e513426b5de7f30cbfeeba171d6ba061f117256176a4506df5741ed9e1e2300
6
+ metadata.gz: d54505db98dde8ba148900bae939ef2db8f1d95ca9e837d7acd2eb8efde5dc51f7b576faa5ee79ddf2b306e79ca5dc5c8330760d9521cb076c3c482a38e93a66
7
+ data.tar.gz: cfd0a649d0afd2c6f18d0ba11e1293fd2bf7030d4d103e23ff8c68df9519308d99660edd4c431eb0fbddd35ed9959e8bff969e9918fac2a1293884772d7cf114
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [0.4.0] - 2026-09-05
2
+
3
+ - Ractors: on Ruby 4.0+, `NOSJ.parse`, `NOSJ.generate`, and every
4
+ other entry point (lazy documents, partial parsing, the file APIs,
5
+ NDJSON, patches, reformatting, statistics) can be called from inside
6
+ a Ractor. Before this release each of them raised
7
+ `Ractor::UnsafeError` outside the main Ractor. Values parsed with
8
+ `freeze: true` are Ractor-shareable, so a document parsed in one
9
+ Ractor can be handed to another without copying.
10
+ - Updated Rust dependencies.
11
+
1
12
  ## [0.3.2] - 2026-07-19
2
13
 
3
14
  - **IMPORTANT**—Fixed: the precompiled platform gems linked `libruby`
data/README.md CHANGED
@@ -16,6 +16,7 @@ faster than Yajl—[see Benchmarks](#benchmarks).
16
16
  - It does **byte-splicing edits**: `NOSJ.splice` changes a field inside a passing payload 10–51× faster than parse-mutate-generate, and RFC 6902 JSON Patch / RFC 7386 merge patch apply straight to the raw string.
17
17
  - It is **great to debug with**: parse errors carry line, column, and a caret snippet pointing at the break, and `NOSJ.stats` X-rays a mystery blob (depth, value counts, key histogram) faster than parsing it.
18
18
  - It accelerates a **Rails** application in both encoding and decoding.
19
+ - It is **Ractor-safe**: call it from any Ractor on Ruby 4.0+, and parse with `freeze: true` to get shareable results.
19
20
  - It comes **precompiled** (platform gems built with per-platform optimizations,
20
21
  nothing to compile on install).
21
22
  - Otherwise, same API and option names as gem json.
@@ -300,6 +301,22 @@ NOSJ.parse(%({\n "a": 1,\n "b": }))
300
301
  # ^
301
302
  ```
302
303
 
304
+ ### Ractors
305
+
306
+ On Ruby 4.0+, every entry point works inside a Ractor: parse and
307
+ generate, lazy documents, partial parsing, the file APIs, NDJSON,
308
+ patches, reformatting, and statistics.
309
+
310
+ ```ruby
311
+ workers = Array.new(4) do
312
+ Ractor.new(payload) { |src| NOSJ.parse(src, freeze: true) }
313
+ end
314
+ workers.map(&:value)
315
+ ```
316
+
317
+ `freeze: true` returns deeply frozen, Ractor-shareable values, so a
318
+ document parsed in one Ractor can be handed to another without a copy.
319
+
303
320
  ## Benchmarks
304
321
 
305
322
  Every installed JSON gem, benchmark-ips: AWS EC2 c7a.2xlarge (AMD EPYC 9R14, Zen 4), Ruby 4.0.6 + YJIT, json 2.21.1, Oj 3.17.4, RapidJSON 0.4.0, FastJsonparser 0.6.0, Yajl 1.4.3, PGO build, 2026-07-16. `×N` = times slower than nosj.
data/lib/nosj/3.3/nosj.so CHANGED
Binary file
data/lib/nosj/3.4/nosj.so CHANGED
Binary file
data/lib/nosj/4.0/nosj.so CHANGED
Binary file
data/lib/nosj/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module NOSJ
4
4
  # The gem version.
5
- VERSION = "0.3.2"
5
+ VERSION = "0.4.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nosj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Yaroslav Markin