X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Fversus-external-pools%2Ffunctions%2Ffunction-to-bench.js;h=ff13bc9ecd2ad04fb034bab8a622198ad748e10a;hb=08aaa20f1cc87dd022265b9bcb4439ddc58cbb3f;hp=3009054ee68658486b737f90ca060bd207a2f2b3;hpb=670734fc5562e286ce17b7f3075d115832e1436a;p=poolifier.git diff --git a/benchmarks/versus-external-pools/functions/function-to-bench.js b/benchmarks/versus-external-pools/functions/function-to-bench.js index 3009054e..ff13bc9e 100644 --- a/benchmarks/versus-external-pools/functions/function-to-bench.js +++ b/benchmarks/versus-external-pools/functions/function-to-bench.js @@ -1,13 +1,13 @@ +'use strict' /** - * The worker function to execute during pools benchmarks. - * NOTE: This function requires to be self-contained, thread-safe and re-entrant. - * + * The task function to execute during pools benchmarks. + * NOTE: This function requires to be self-contained, thread-safe and re-entrant (node-worker-threads-pool requirement). * @param {*} data The worker data. * @returns {*} The result. */ -function functionToBench (data) { - const crypto = require('crypto') - const fs = require('fs') +const functionToBench = data => { + const crypto = require('node:crypto') + const fs = require('node:fs') const TaskTypes = { CPU_INTENSIVE: 'CPU_INTENSIVE', IO_INTENSIVE: 'IO_INTENSIVE'