X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=benchmarks%2Fbenchmarks-utils.mjs;fp=benchmarks%2Fbenchmarks-utils.js;h=45e8cc0ea5882ae0804664d8f25e88f7265f6fe8;hb=8f810074232deefe64634a8942b1db5b8d3bb0dc;hp=6195a983c3fe98da9e8f68e06dbc96818773c1fc;hpb=8a97042123ae9a0404637711b8da7c6e7e4424c7;p=poolifier.git 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 6195a983..45e8cc0e 100644 --- a/benchmarks/benchmarks-utils.js +++ b/benchmarks/benchmarks-utils.mjs @@ -1,16 +1,12 @@ -const crypto = require('crypto') -const fs = require('fs') -const { +import crypto from 'crypto' +import fs from 'fs' +import { 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) => { @@ -151,7 +147,7 @@ function buildPool (workerType, poolType, poolSize, poolOptions) { } } -module.exports = { +export { WorkerFunctions, buildPool, executeWorkerFunction,