repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build(deps-dev): apply updates
[poolifier.git]
/
benchmarks
/
worker-selection
/
least.mjs
diff --git
a/benchmarks/worker-selection/least.mjs
b/benchmarks/worker-selection/least.mjs
index 2abbae8275c147187a486b368ffec84c3bdcd579..f67bebf7464f5ff7cadc394d38279bfc76e804bc 100644
(file)
--- a/
benchmarks/worker-selection/least.mjs
+++ b/
benchmarks/worker-selection/least.mjs
@@
-1,5
+1,6
@@
+import { randomInt } from 'node:crypto'
import Benchmark from 'benchmark'
import Benchmark from 'benchmark'
-import { LIST_FORMATTER
, generateRandomInteger } from '../benchmarks-utils.m
js'
+import { LIST_FORMATTER
} from '../benchmarks-utils.c
js'
function generateRandomTasksMap (
numberOfWorkers,
function generateRandomTasksMap (
numberOfWorkers,
@@
-7,7
+8,7
@@
function generateRandomTasksMap (
) {
const tasksArray = []
for (let i = 0; i < numberOfWorkers; i++) {
) {
const tasksArray = []
for (let i = 0; i < numberOfWorkers; i++) {
- const task = [i,
generateRandomInteger
(maxNumberOfTasksPerWorker)]
+ const task = [i,
randomInt
(maxNumberOfTasksPerWorker)]
tasksArray.push(task)
}
return new Map(tasksArray)
tasksArray.push(task)
}
return new Map(tasksArray)
@@
-50,7
+51,7
@@
const defaultPivotIndexSelect = (leftIndex, rightIndex) => {
}
const randomPivotIndexSelect = (leftIndex, rightIndex) => {
}
const randomPivotIndexSelect = (leftIndex, rightIndex) => {
- return
generateRandomInteger(rightIndex, lef
tIndex)
+ return
randomInt(leftIndex, righ
tIndex)
}
function swap (array, index1, index2) {
}
function swap (array, index1, index2) {