X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fthread%2Fworker.js;h=09060ebad46032264aea8dd3f60df085cba81b8c;hb=d49303bcd1dc86f36030dff08796f869681d4eae;hp=5196ca38c9758e24120a2ac45576cbdc49d26d12;hpb=23ff945ac0bc3b9bcf98c6491872cffaac805b73;p=poolifier.git diff --git a/benchmarks/internal/thread/worker.js b/benchmarks/internal/thread/worker.js index 5196ca38..09060eba 100644 --- a/benchmarks/internal/thread/worker.js +++ b/benchmarks/internal/thread/worker.js @@ -1,12 +1,15 @@ 'use strict' const { isMainThread } = require('worker_threads') const { ThreadWorker } = require('../../../lib/index') -const { jsonIntegerSerialization } = require('../benchmark-utils') +const { executeWorkerFunction } = require('../../benchmarks-utils') +const { WorkerFunctions } = require('../../benchmarks-types') const debug = false function yourFunction (data) { - jsonIntegerSerialization(1000) + data = data || {} + data.function = data.function || WorkerFunctions.jsonIntegerSerialization + executeWorkerFunction(data) debug === true && console.debug('This is the main thread ' + isMainThread) return { ok: 1 } }