fix: fixed performance cores count in the pCores stress test

This commit is contained in:
Serhiy Mytrovtsiy
2025-02-22 18:44:07 +01:00
parent 6ddf1b1853
commit 9ab2b045db

View File

@@ -1676,16 +1676,16 @@ public class CPUpStressTest {
private var workers: [DispatchWorkItem] = []
private let queue = DispatchQueue.global(qos: .userInteractive)
public init() {}
public func start() {
guard !self.isRunning else { return }
self.isRunning = true
let performanceCoreCount = ProcessInfo.processInfo.activeProcessorCount
let performanceCoreCount: Int = Int(SystemKit.shared.device.info.cpu?.pCores ?? 4)
self.workers.removeAll()
for index in 0..<performanceCoreCount {
let worker = DispatchWorkItem { [weak self] in
self?.test(threadIndex: index)