X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fcluster%2Fworker.js;h=0235afface236f2e2492e669636d74df37770c81;hb=3f7eb773a2c8775fa263b696b6a611e484e437a8;hp=b4d54fca9976e65bbbb76da3ff5d54a4673815ff;hpb=6e9d10db05ac2bbc85373195a5c885d2492fee61;p=poolifier.git diff --git a/benchmarks/internal/cluster/worker.js b/benchmarks/internal/cluster/worker.js index b4d54fca..0235affa 100644 --- a/benchmarks/internal/cluster/worker.js +++ b/benchmarks/internal/cluster/worker.js @@ -1,14 +1,13 @@ 'use strict' +const { isMaster } = require('cluster') const { ClusterWorker } = require('../../../lib/index') +const { jsonIntegerSerialization } = require('../benchmark-utils') + +const debug = false function yourFunction (data) { - for (let i = 0; i < 1000; i++) { - const o = { - a: i - } - JSON.stringify(o) - } - // console.log('This is the main thread ' + isMaster) + jsonIntegerSerialization(1000) + debug === true && console.debug('This is the main thread ' + isMaster) return { ok: 1 } }