repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: convert to ESM benchmarks code
[poolifier.git]
/
benchmarks
/
benchmarks-utils.mjs
diff --git
a/benchmarks/benchmarks-utils.js
b/benchmarks/benchmarks-utils.mjs
similarity index 95%
rename from
benchmarks/benchmarks-utils.js
rename to
benchmarks/benchmarks-utils.mjs
index 6195a983c3fe98da9e8f68e06dbc96818773c1fc..45e8cc0ea5882ae0804664d8f25e88f7265f6fe8 100644
(file)
--- a/
benchmarks/benchmarks-utils.js
+++ b/
benchmarks/benchmarks-utils.mjs
@@
-1,16
+1,12
@@
-const crypto = require('crypto')
-const fs = require('fs')
-
cons
t {
+import crypto from 'crypto'
+import fs from 'fs'
+
impor
t {
DynamicClusterPool,
DynamicThreadPool,
FixedClusterPool,
FixedThreadPool
DynamicClusterPool,
DynamicThreadPool,
FixedClusterPool,
FixedThreadPool
-} = require('../lib')
-const {
- PoolTypes,
- WorkerFunctions,
- WorkerTypes
-} = require('./benchmarks-types')
+} from '../lib/index.mjs'
+import { PoolTypes, WorkerFunctions, WorkerTypes } from './benchmarks-types.mjs'
async function runTest (pool, { taskExecutions, workerData }) {
return new Promise((resolve, reject) => {
async function runTest (pool, { taskExecutions, workerData }) {
return new Promise((resolve, reject) => {
@@
-151,7
+147,7
@@
function buildPool (workerType, poolType, poolSize, poolOptions) {
}
}
}
}
-
module.exports =
{
+
export
{
WorkerFunctions,
buildPool,
executeWorkerFunction,
WorkerFunctions,
buildPool,
executeWorkerFunction,