repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
README.md: fix typo
[poolifier.git]
/
benchmarks
/
internal
/
cluster
/
worker.js
diff --git
a/benchmarks/internal/cluster/worker.js
b/benchmarks/internal/cluster/worker.js
index 0235afface236f2e2492e669636d74df37770c81..29005f9c219bc9b932317d291dc8f059a2819d47 100644
(file)
--- a/
benchmarks/internal/cluster/worker.js
+++ b/
benchmarks/internal/cluster/worker.js
@@
-1,12
+1,14
@@
'use strict'
const { isMaster } = require('cluster')
const { ClusterWorker } = require('../../../lib/index')
'use strict'
const { isMaster } = require('cluster')
const { ClusterWorker } = require('../../../lib/index')
-const {
jsonIntegerSerializa
tion } = require('../benchmark-utils')
+const {
WorkerFunctions, executeWorkerFunc
tion } = require('../benchmark-utils')
const debug = false
function yourFunction (data) {
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 ' + isMaster)
return { ok: 1 }
}
debug === true && console.debug('This is the main thread ' + isMaster)
return { ok: 1 }
}