From 4ea1fc51565354e2d0797f3ceae24e09548f4b51 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 8 Jun 2024 17:53:51 +0200 Subject: [PATCH 1/2] Improve speed for windows `Get-CimInstance` This only fetches a single property which is faster --- lib/concurrent-ruby/concurrent/utility/processor_counter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/concurrent-ruby/concurrent/utility/processor_counter.rb b/lib/concurrent-ruby/concurrent/utility/processor_counter.rb index d5274620e..6724457f1 100644 --- a/lib/concurrent-ruby/concurrent/utility/processor_counter.rb +++ b/lib/concurrent-ruby/concurrent/utility/processor_counter.rb @@ -69,7 +69,7 @@ def compute_physical_processor_count cores.count when /mswin|mingw/ # Get-CimInstance introduced in PowerShell 3 or earlier: https://learn.microsoft.com/en-us/previous-versions/powershell/module/cimcmdlets/get-ciminstance?view=powershell-3.0 - result = run('powershell -command "Get-CimInstance -ClassName Win32_Processor | Select-Object -Property NumberOfCores"') + result = run('powershell -command "Get-CimInstance -ClassName Win32_Processor -Property NumberOfCores | Select-Object -Property NumberOfCores"') if !result || $?.exitstatus != 0 # fallback to deprecated wmic for older systems result = run("wmic cpu get NumberOfCores") From b16af1e977c20e47bbab287ae92f2d397c7694b0 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 9 Jun 2024 16:33:25 +0200 Subject: [PATCH 2/2] 1.3.3 --- CHANGELOG.md | 6 +++++- lib/concurrent-ruby/concurrent/version.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db8fd7964..c117834d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ ## Current -## Release v1.3.2, edge v0.7.1 (29 May 2024) +## Release v1.3.3 (9 June 2024) + +* (#1053) Improve the speed of `Concurrent.physical_processor_count` on Windows. + +## Release v1.3.2, edge v0.7.1 (7 June 2024) concurrent-ruby: diff --git a/lib/concurrent-ruby/concurrent/version.rb b/lib/concurrent-ruby/concurrent/version.rb index e449c62bc..98e7f12b3 100644 --- a/lib/concurrent-ruby/concurrent/version.rb +++ b/lib/concurrent-ruby/concurrent/version.rb @@ -1,3 +1,3 @@ module Concurrent - VERSION = '1.3.2' + VERSION = '1.3.3' end