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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92cd4e59e4d535fa78b28db19057fc09d648fb6fc2dda3b8012a40d3f73e35c2
4
- data.tar.gz: db993dd73dd11b2c4b38f2b0fd6dea04ab90518085e96b6d32280094f59121d0
3
+ metadata.gz: cbff599b89da12411b8896f110fdb748ac3031726e2a74965a61a844f651a02a
4
+ data.tar.gz: 3395dbc5d6f018e2b6450db745b9985d780253e41c410ae5b726ba5f0f64dc8d
5
5
  SHA512:
6
- metadata.gz: 97efcd71efe6a831882634cfd5fefac5aeb3888c7ebd2910833725c4fa4aec8148e46aa125311a332aa638c399975cd41cf9a1275c7bb60456995476a16b1a55
7
- data.tar.gz: 2938f755a27f81e655128d9e1a7bcf22af7559a6d1ff0f984228848ea6c9531d46c33af4b83c6e843ac071d517ec148d2b447b8de8eddc037dd0abd09ec0df9c
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.2.0...HEAD
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 `only: :timing`, as benchmarks with
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", only: :timing do |n|
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Duel
4
4
  module GVL
5
- VERSION = "0.2.0"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
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 ratio metric, in nanoseconds) is measured for benchmarks with
16
- # threads of their own (only: :timing), and left out of the rest, whose
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: :ratio, unit: "ns", cpu_floor: CPU_FLOOR, limit: LIMIT, sizes_samples: false, across: false}}
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.only == :timing
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.2.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: "0.2"
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: "0.2"
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