### Changed
- Optimize O(1) queue implementation.
-- Optimize worker choice strategies: pre-choose the worker node key by executing the choice algorithm after tasks submission.
## [2.6.2] - 2023-06-12
/** @inheritDoc */
public update (workerNodeKey: number): boolean {
this.computeWorkerVirtualTaskEndTimestamp(workerNodeKey)
+ return true
+ }
+
+ /** @inheritDoc */
+ public choose (): number {
let minWorkerVirtualTaskEndTimestamp = Infinity
for (const [workerNodeKey] of this.pool.workerNodes.entries()) {
if (this.workersVirtualTaskEndTimestamp[workerNodeKey] == null) {
this.nextWorkerNodeId = workerNodeKey
}
}
- return true
- }
-
- /** @inheritDoc */
- public choose (): number {
return this.nextWorkerNodeId
}
/** @inheritDoc */
public update (): boolean {
+ return true
+ }
+
+ /** @inheritDoc */
+ public choose (): number {
let minTime = Infinity
for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) {
const workerTime =
this.nextWorkerNodeId = workerNodeKey
}
}
- return true
- }
-
- /** @inheritDoc */
- public choose (): number {
return this.nextWorkerNodeId
}
/** @inheritDoc */
public update (): boolean {
+ return true
+ }
+
+ /** @inheritDoc */
+ public choose (): number {
let minWorkerElu = Infinity
for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) {
const workerUsage = workerNode.workerUsage
this.nextWorkerNodeId = workerNodeKey
}
}
- return true
- }
-
- /** @inheritDoc */
- public choose (): number {
return this.nextWorkerNodeId
}
/** @inheritDoc */
public update (): boolean {
+ return true
+ }
+
+ /** @inheritDoc */
+ public choose (): number {
let minNumberOfTasks = Infinity
for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) {
const workerTaskStatistics = workerNode.workerUsage.tasks
this.nextWorkerNodeId = workerNodeKey
}
}
- return true
- }
-
- /** @inheritDoc */
- public choose (): number {
return this.nextWorkerNodeId
}