summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
76407b8)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
### Changed
- Optimize O(1) queue implementation.
### Changed
- Optimize O(1) queue implementation.
-- Optimize worker choice strategies: pre-choose the worker node key by executing the choice algorithm after tasks submission.
/** @inheritDoc */
public update (workerNodeKey: number): boolean {
this.computeWorkerVirtualTaskEndTimestamp(workerNodeKey)
/** @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) {
let minWorkerVirtualTaskEndTimestamp = Infinity
for (const [workerNodeKey] of this.pool.workerNodes.entries()) {
if (this.workersVirtualTaskEndTimestamp[workerNodeKey] == null) {
this.nextWorkerNodeId = workerNodeKey
}
}
this.nextWorkerNodeId = workerNodeKey
}
}
- return true
- }
-
- /** @inheritDoc */
- public choose (): number {
return this.nextWorkerNodeId
}
return this.nextWorkerNodeId
}
/** @inheritDoc */
public update (): boolean {
/** @inheritDoc */
public update (): boolean {
+ return true
+ }
+
+ /** @inheritDoc */
+ public choose (): number {
let minTime = Infinity
for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) {
const workerTime =
let minTime = Infinity
for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) {
const workerTime =
this.nextWorkerNodeId = workerNodeKey
}
}
this.nextWorkerNodeId = workerNodeKey
}
}
- return true
- }
-
- /** @inheritDoc */
- public choose (): number {
return this.nextWorkerNodeId
}
return this.nextWorkerNodeId
}
/** @inheritDoc */
public update (): boolean {
/** @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
let minWorkerElu = Infinity
for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) {
const workerUsage = workerNode.workerUsage
this.nextWorkerNodeId = workerNodeKey
}
}
this.nextWorkerNodeId = workerNodeKey
}
}
- return true
- }
-
- /** @inheritDoc */
- public choose (): number {
return this.nextWorkerNodeId
}
return this.nextWorkerNodeId
}
/** @inheritDoc */
public update (): boolean {
/** @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
let minNumberOfTasks = Infinity
for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) {
const workerTaskStatistics = workerNode.workerUsage.tasks
this.nextWorkerNodeId = workerNodeKey
}
}
this.nextWorkerNodeId = workerNodeKey
}
}
- return true
- }
-
- /** @inheritDoc */
- public choose (): number {
return this.nextWorkerNodeId
}
return this.nextWorkerNodeId
}