## [Unreleased]
+### Added
+
+- Add `LESS_BUSY` worker choice strategy.
+
+### Changed
+
+- Optimize worker storage in pool.
+- Optimize worker alive status check.
+- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
+- Optimize `LESS_USED` worker choice strategy.
+- Update benchmarks versus external threads pools.
+- Optimize tasks usage statistics requirements for worker choice strategy.
+
+### Fixed
+
+- Ensure trimmable characters are checked at pool initialization.
+- Fix message id integer overflow.
+- Fix pool worker removal in worker choice strategy internals.
+- Fix package publication with pnpm.
+
## [2.4.0-3] - 2023-04-04
### Added
}
if (this.workerChoiceStrategyContext.getRequiredStatistics().runTime) {
workerTasksUsage.runTime += message.taskRunTime ?? 0
- if (workerTasksUsage.run !== 0) {
+ if (
+ this.workerChoiceStrategyContext.getRequiredStatistics().avgRunTime &&
+ workerTasksUsage.run !== 0
+ ) {
workerTasksUsage.avgRunTime =
workerTasksUsage.runTime / workerTasksUsage.run
}
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(false)
+ expect(
+ pool.workerChoiceStrategyContext.getRequiredStatistics().avgRunTime
+ ).toBe(false)
await pool.destroy()
pool = new DynamicThreadPool(
min,
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(false)
+ expect(
+ pool.workerChoiceStrategyContext.getRequiredStatistics().avgRunTime
+ ).toBe(false)
// We need to clean up the resources after our test
await pool.destroy()
})
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(false)
+ expect(
+ pool.workerChoiceStrategyContext.getRequiredStatistics().avgRunTime
+ ).toBe(false)
await pool.destroy()
pool = new DynamicThreadPool(
min,
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(false)
+ expect(
+ pool.workerChoiceStrategyContext.getRequiredStatistics().avgRunTime
+ ).toBe(false)
// We need to clean up the resources after our test
await pool.destroy()
})
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(true)
+ expect(
+ pool.workerChoiceStrategyContext.getRequiredStatistics().avgRunTime
+ ).toBe(false)
await pool.destroy()
pool = new DynamicThreadPool(
min,
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(true)
+ expect(
+ pool.workerChoiceStrategyContext.getRequiredStatistics().avgRunTime
+ ).toBe(false)
// We need to clean up the resources after our test
await pool.destroy()
})
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(true)
+ expect(
+ pool.workerChoiceStrategyContext.getRequiredStatistics().avgRunTime
+ ).toBe(true)
await pool.destroy()
pool = new DynamicThreadPool(
min,
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(true)
+ expect(
+ pool.workerChoiceStrategyContext.getRequiredStatistics().avgRunTime
+ ).toBe(true)
// We need to clean up the resources after our test
await pool.destroy()
})
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(true)
+ expect(
+ pool.workerChoiceStrategyContext.getRequiredStatistics().avgRunTime
+ ).toBe(true)
await pool.destroy()
pool = new DynamicThreadPool(
min,
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(true)
+ expect(
+ pool.workerChoiceStrategyContext.getRequiredStatistics().avgRunTime
+ ).toBe(true)
// We need to clean up the resources after our test
await pool.destroy()
})