duel-gvl 0.2.0 → 0.3.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/CHANGELOG.md +13 -1
- data/README.md +2 -2
- data/lib/duel/gvl/version.rb +1 -1
- data/lib/duel/gvl.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cbff599b89da12411b8896f110fdb748ac3031726e2a74965a61a844f651a02a
|
|
4
|
+
data.tar.gz: 3395dbc5d6f018e2b6450db745b9985d780253e41c410ae5b726ba5f0f64dc8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ec2b713c125b7052817955a929818622dfade357e89cdaf1c60508e42a1b8446c4754056494b0dcc846efbdf5b12fd84b70642dd50899bb2ee63c3c6b57fafe6
|
|
7
|
+
data.tar.gz: d59d06f437ee9674bd64c224c446a8444862bb18c77b473a0153377ba791c44c0e8a3ba1caf20036eebd8c721ce021074d2448c65d19ab85b404b57c5aaa374d
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.3.0] - 2026-11-20
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- `gvl_wait`'s settings say `size_samples: false`, as Duel 0.3.0 names
|
|
15
|
+
`sizes_samples:`.
|
|
16
|
+
- `gvl_wait` measures the benchmarks judged on their timings alone,
|
|
17
|
+
`judge: :timed`, which Duel's `only: :timing` became.
|
|
18
|
+
- It requires Duel 0.3.0 or later (`~> 0.3.0`), the release it's
|
|
19
|
+
tested with, as Duel 0.3.0 changes what plugins and benchmarks call.
|
|
20
|
+
|
|
10
21
|
## [0.2.0] - 2026-11-16
|
|
11
22
|
|
|
12
23
|
No changes of its own: released in step with the other Duel gems.
|
|
@@ -61,7 +72,8 @@ nothing).
|
|
|
61
72
|
(`unit: "ns"`), so reports show it as time (`51.16µs → 817.9µs an
|
|
62
73
|
iteration`).
|
|
63
74
|
|
|
64
|
-
[Unreleased]: https://github.com/sferik/duel-ruby/compare/duel-gvl-v0.
|
|
75
|
+
[Unreleased]: https://github.com/sferik/duel-ruby/compare/duel-gvl-v0.3.0...HEAD
|
|
76
|
+
[0.3.0]: https://github.com/sferik/duel-ruby/compare/duel-gvl-v0.2.0...duel-gvl-v0.3.0
|
|
65
77
|
[0.2.0]: https://github.com/sferik/duel-ruby/compare/duel-gvl-v0.1.8...duel-gvl-v0.2.0
|
|
66
78
|
[0.1.8]: https://github.com/sferik/duel-ruby/compare/duel-gvl-v0.1.7...duel-gvl-v0.1.8
|
|
67
79
|
[0.1.7]: https://github.com/sferik/duel-ruby/compare/duel-gvl-v0.1.6...duel-gvl-v0.1.7
|
data/README.md
CHANGED
|
@@ -50,13 +50,13 @@ end
|
|
|
50
50
|
Duel.configure { |c| c.use :gvl }
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
It measures only benchmarks marked `
|
|
53
|
+
It measures only benchmarks marked `judge: :timed`, as benchmarks with
|
|
54
54
|
threads of their own should be (their counts vary from run to run). The
|
|
55
55
|
rest have one thread and nothing to wait for:
|
|
56
56
|
|
|
57
57
|
```ruby
|
|
58
58
|
# duel/pool_duel.rb
|
|
59
|
-
duel "pool: 4 threads",
|
|
59
|
+
duel "pool: 4 threads", judge: :timed do |n|
|
|
60
60
|
jobs = Thread::Queue.new(Array.new(n) { |i| i }).tap(&:close)
|
|
61
61
|
Array.new(4) { Thread.new { while (job = jobs.pop) do MyPool.handle(job) end } }.each(&:join)
|
|
62
62
|
end
|
data/lib/duel/gvl/version.rb
CHANGED
data/lib/duel/gvl.rb
CHANGED
|
@@ -12,8 +12,8 @@ module Duel
|
|
|
12
12
|
# # .duel.rb
|
|
13
13
|
# Duel.configure { |c| c.use :gvl }
|
|
14
14
|
#
|
|
15
|
-
# gvl_wait (a
|
|
16
|
-
# threads of their own (
|
|
15
|
+
# gvl_wait (a timed metric, in nanoseconds) is measured for benchmarks with
|
|
16
|
+
# threads of their own (judge: :timed), and left out of the rest, whose
|
|
17
17
|
# one thread has nothing to wait for. It needs CRuby and the gem's C
|
|
18
18
|
# extension (Duel::GVL::Hook); elsewhere it's left out.
|
|
19
19
|
module GVL
|
|
@@ -75,12 +75,12 @@ module Duel
|
|
|
75
75
|
|
|
76
76
|
LIMIT = 1.5
|
|
77
77
|
|
|
78
|
-
def self.measures = {"gvl_wait" => {kind: :
|
|
78
|
+
def self.measures = {"gvl_wait" => {kind: :timed, unit: "ns", cpu_floor: CPU_FLOOR, limit: LIMIT, size_samples: false, across: false}}
|
|
79
79
|
|
|
80
80
|
def self.available? = GVL.available?
|
|
81
81
|
|
|
82
82
|
def start_sample(sample)
|
|
83
|
-
@measuring = sample.benchmark.
|
|
83
|
+
@measuring = !sample.benchmark.counted?
|
|
84
84
|
return unless @measuring
|
|
85
85
|
|
|
86
86
|
Hook.start
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: duel-gvl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Erik Berlin
|
|
@@ -16,7 +16,7 @@ dependencies:
|
|
|
16
16
|
-
|
|
17
17
|
- ~>
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: 0.3.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -24,7 +24,7 @@ dependencies:
|
|
|
24
24
|
-
|
|
25
25
|
- ~>
|
|
26
26
|
- !ruby/object:Gem::Version
|
|
27
|
-
version:
|
|
27
|
+
version: 0.3.0
|
|
28
28
|
description: "A Duel plugin: benchmarks with threads of their own are judged on how long their threads waited for the GVL too, so a change that adds contention fails even when its CPU time doesn't."
|
|
29
29
|
email:
|
|
30
30
|
- sferik@gmail.com
|