nosj 0.3.1-aarch64-linux → 0.4.0-aarch64-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: 9d1c48677ffc867030f5f2fbf43842509cc8412415d93c16eabdfea9ec8f2e86
4
- data.tar.gz: 2469b7844b7faebd71ed211e3e9b14098b6782ec1284d0a8927ae5054d99fdea
3
+ metadata.gz: fd883bdfebc07e316c4baa1706cd9ba6b8036645a8cbd0b8b9b5a888c3a0e3c5
4
+ data.tar.gz: f73808429bfdf03043716ceb4b3d01a3536a4b6d2f1c092f15b54dff52ef9c82
5
5
  SHA512:
6
- metadata.gz: 6bdf4484d310a5f0f868b13b2c7c1b3f9e57e1da773f665bcd276b52f98055428aa9c0b4d37b30c13502ff380aea3e9f520da412dae12388bb4b622e1dd9acc1
7
- data.tar.gz: a874c09f066ed4d37595228e5bc91cc69b646a72ed793b73e9d3eb37f5395a234356af48bd5469dc26aac250e90b69e449377847f0b2c4587dda0a3585ce691d
6
+ metadata.gz: 7dab8b234f37fa22a4ab1a5f0bfb906df9ecb6d85ecba50f63e5634d309387ea0ce4302eda8e2280d182ae69d0067ee852d4b23773d1c1c4164c1b6ed708cadf
7
+ data.tar.gz: '0909f76cdcd4d49f015ee951d14f785312d91e6cc6ff61c18be8fe5c091f068c546f7a5f2d5a41cbce0db75de9fd4c20ddfbcca249906997f2c7a09fc8380f96'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
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
+
12
+ ## [0.3.2] - 2026-07-19
13
+
14
+ - **IMPORTANT**—Fixed: the precompiled platform gems linked `libruby`
15
+ into the extension. The arm64-darwin binaries recorded the build runner's
16
+ absolute Ruby path, so `require "nosj"` failed with `Library not
17
+ loaded: /Users/runner/hostedtoolcache/...` on any machine with Ruby
18
+ installed elsewhere (#2), and the Linux binaries carried a
19
+ `libruby.so` runtime dependency that a statically built Ruby (the
20
+ ruby-build default) cannot satisfy. The cause was magnus's `embed`
21
+ feature—needed only by the fuzz harness, which now enables it
22
+ itself—pulling `rb-sys/link-ruby` into the gem build. Extension
23
+ symbols now resolve from the host process at load time, and the
24
+ release build refuses to stage a binary that links libruby.
25
+
1
26
  ## [0.3.1] - 2026-07-17
2
27
 
3
28
  - Fixed: `NOSJ.minify` / `NOSJ.reformat` produced unparseable output
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.1"
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.1
4
+ version: 0.4.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Yaroslav Markin