atomic-ruby 0.6.4 → 0.6.6
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/CHANGELOG.md +8 -0
- data/README.md +23 -20
- data/lib/atomic-ruby/atom.rb +4 -0
- data/lib/atomic-ruby/atomic_boolean.rb +2 -0
- data/lib/atomic-ruby/atomic_count_down_latch.rb +2 -0
- data/lib/atomic-ruby/atomic_thread_pool.rb +2 -0
- data/lib/atomic-ruby/version.rb +1 -1
- data/lib/atomic-ruby.rb +0 -7
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71ab1390a71e724460d0331491b033a45d4dd1fb19308d62ffdcbf68bf68b149
|
|
4
|
+
data.tar.gz: e19d576cd3ad1756ea5b429b6d57ab5e34402b3cf19674c597abc80a9f4b5f36
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b0db49db3fde19a7a6c7fe3adc58f999943b09e2074b88a79489ad6103712c2c4c2abf88a0d73ab1c7fe9e51dffeaa24c18c5d5519738d71d5fe8d7512855a5e
|
|
7
|
+
data.tar.gz: f2d93730a210f1886d83c9971be5fa73acd8fa754c727008fd355899dc9cb2dfe90bb1fb7791663e2457f37b2adc74078a71f8f812c0f105132bcc7f68994468
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.6.6] - 2025-10-16
|
|
4
|
+
|
|
5
|
+
- Fix individual file requires
|
|
6
|
+
|
|
7
|
+
## [0.6.5] - 2025-10-16
|
|
8
|
+
|
|
9
|
+
- Move shortcut aliases for `AtomicRuby` namespaced classes to respective files
|
|
10
|
+
|
|
3
11
|
## [0.6.4] - 2025-10-15
|
|
4
12
|
|
|
5
13
|
- Fix Ractor safety by properly marking native extension methods as safe
|
data/README.md
CHANGED
|
@@ -97,6 +97,9 @@ latch.wait
|
|
|
97
97
|
p latch.count #=> 0
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
+
> [!NOTE]
|
|
101
|
+
> `Atom`, `AtomicBoolean`, and `AtomicCountDownLatch` are also Ractor safe.
|
|
102
|
+
|
|
100
103
|
## Benchmarks
|
|
101
104
|
|
|
102
105
|
<details>
|
|
@@ -207,9 +210,9 @@ puts "Atomic Ruby Atomic Bank Account: #{results[2].real.round(6)} seconds"
|
|
|
207
210
|
```
|
|
208
211
|
> bundle exec rake compile && bundle exec ruby examples/atom_benchmark.rb
|
|
209
212
|
|
|
210
|
-
ruby version: ruby 3.4.
|
|
213
|
+
ruby version: ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +YJIT +PRISM [arm64-darwin25]
|
|
211
214
|
concurrent-ruby version: 1.3.5
|
|
212
|
-
atomic-ruby version: 0.4
|
|
215
|
+
atomic-ruby version: 0.6.4
|
|
213
216
|
|
|
214
217
|
Balances:
|
|
215
218
|
Synchronized Bank Account Balance: 975
|
|
@@ -217,9 +220,9 @@ Concurrent Ruby Atomic Bank Account Balance: 975
|
|
|
217
220
|
Atomic Ruby Atomic Bank Account Balance: 975
|
|
218
221
|
|
|
219
222
|
Benchmark Results:
|
|
220
|
-
Synchronized Bank Account: 5.
|
|
221
|
-
Concurrent Ruby Atomic Bank Account: 5.
|
|
222
|
-
Atomic Ruby Atomic Bank Account: 5.
|
|
223
|
+
Synchronized Bank Account: 5.110797 seconds
|
|
224
|
+
Concurrent Ruby Atomic Bank Account: 5.118082 seconds
|
|
225
|
+
Atomic Ruby Atomic Bank Account: 5.087287 seconds
|
|
223
226
|
```
|
|
224
227
|
|
|
225
228
|
</details>
|
|
@@ -298,29 +301,29 @@ end
|
|
|
298
301
|
```
|
|
299
302
|
> bundle exec rake compile && bundle exec ruby examples/atomic_boolean_benchmark.rb
|
|
300
303
|
|
|
301
|
-
ruby version: ruby 3.4.
|
|
304
|
+
ruby version: ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +YJIT +PRISM [arm64-darwin25]
|
|
302
305
|
concurrent-ruby version: 1.3.5
|
|
303
|
-
atomic-ruby version: 0.4
|
|
306
|
+
atomic-ruby version: 0.6.4
|
|
304
307
|
|
|
305
308
|
Warming up --------------------------------------
|
|
306
309
|
Synchronized Boolean Toggle
|
|
307
|
-
|
|
310
|
+
103.000 i/100ms
|
|
308
311
|
Concurrent Ruby Atomic Boolean Toggle
|
|
309
|
-
|
|
312
|
+
84.000 i/100ms
|
|
310
313
|
Atomic Ruby Atomic Boolean Toggle
|
|
311
|
-
|
|
314
|
+
115.000 i/100ms
|
|
312
315
|
Calculating -------------------------------------
|
|
313
316
|
Synchronized Boolean Toggle
|
|
314
|
-
1.
|
|
317
|
+
1.052k (± 3.9%) i/s (950.20 μs/i) - 5.356k in 5.097149s
|
|
315
318
|
Concurrent Ruby Atomic Boolean Toggle
|
|
316
|
-
|
|
319
|
+
872.073 (± 3.2%) i/s (1.15 ms/i) - 4.368k in 5.013857s
|
|
317
320
|
Atomic Ruby Atomic Boolean Toggle
|
|
318
|
-
1.
|
|
321
|
+
1.214k (± 1.5%) i/s (823.94 μs/i) - 6.095k in 5.023014s
|
|
319
322
|
|
|
320
323
|
Comparison:
|
|
321
|
-
Atomic Ruby Atomic Boolean Toggle:
|
|
322
|
-
Synchronized Boolean Toggle:
|
|
323
|
-
Concurrent Ruby Atomic Boolean Toggle:
|
|
324
|
+
Atomic Ruby Atomic Boolean Toggle: 1213.7 i/s
|
|
325
|
+
Synchronized Boolean Toggle: 1052.4 i/s - 1.15x slower
|
|
326
|
+
Concurrent Ruby Atomic Boolean Toggle: 872.1 i/s - 1.39x slower
|
|
324
327
|
```
|
|
325
328
|
|
|
326
329
|
</details>
|
|
@@ -376,13 +379,13 @@ puts "Atomic Ruby Atomic Thread Pool: #{results[1].real.round(6)} seconds"
|
|
|
376
379
|
```
|
|
377
380
|
> bundle exec rake compile && bundle exec ruby examples/atomic_thread_pool_benchmark.rb
|
|
378
381
|
|
|
379
|
-
ruby version: ruby 3.4.
|
|
382
|
+
ruby version: ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +YJIT +PRISM [arm64-darwin25]
|
|
380
383
|
concurrent-ruby version: 1.3.5
|
|
381
|
-
atomic-ruby version: 0.4
|
|
384
|
+
atomic-ruby version: 0.6.4
|
|
382
385
|
|
|
383
386
|
Benchmark Results:
|
|
384
|
-
Concurrent Ruby Thread Pool:
|
|
385
|
-
Atomic Ruby Atomic Thread Pool: 4.
|
|
387
|
+
Concurrent Ruby Thread Pool: 4.768847 seconds
|
|
388
|
+
Atomic Ruby Atomic Thread Pool: 4.401936 seconds
|
|
386
389
|
```
|
|
387
390
|
|
|
388
391
|
</details>
|
data/lib/atomic-ruby/atom.rb
CHANGED
data/lib/atomic-ruby/version.rb
CHANGED
data/lib/atomic-ruby.rb
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "atomic_ruby/atomic_ruby"
|
|
4
|
-
|
|
5
3
|
require_relative "atomic-ruby/version"
|
|
6
4
|
require_relative "atomic-ruby/atom"
|
|
7
5
|
require_relative "atomic-ruby/atomic_boolean"
|
|
8
6
|
require_relative "atomic-ruby/atomic_thread_pool"
|
|
9
7
|
require_relative "atomic-ruby/atomic_count_down_latch"
|
|
10
|
-
|
|
11
|
-
Atom = AtomicRuby::Atom
|
|
12
|
-
AtomicBoolean = AtomicRuby::AtomicBoolean
|
|
13
|
-
AtomicThreadPool = AtomicRuby::AtomicThreadPool
|
|
14
|
-
AtomicCountDownLatch = AtomicRuby::AtomicCountDownLatch
|