repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of github.com:jerome-benoit/poolifier
[poolifier.git]
/
benchmarks
/
internal
/
thread-worker.mjs
diff --git
a/benchmarks/internal/thread-worker.mjs
b/benchmarks/internal/thread-worker.mjs
index 4f66a89a7356c49813c27ff2150839be5ad0356d..88d57670f712bae8528724dfeef28d310eb29f65 100644
(file)
--- a/
benchmarks/internal/thread-worker.mjs
+++ b/
benchmarks/internal/thread-worker.mjs
@@
-1,16
+1,16
@@
import { isMainThread } from 'worker_threads'
import { ThreadWorker } from '../../lib/index.mjs'
import { isMainThread } from 'worker_threads'
import { ThreadWorker } from '../../lib/index.mjs'
-import { executeWorkerFunction } from '../benchmarks-utils.js'
-import { WorkerFunctions } from '../benchmarks-types.js'
+import { executeWorkerFunction } from '../benchmarks-utils.
m
js'
+import { WorkerFunctions } from '../benchmarks-types.
m
js'
const debug = false
const debug = false
-function
you
rFunction (data) {
+function
worke
rFunction (data) {
data = data || {}
data.function = data.function || WorkerFunctions.jsonIntegerSerialization
data = data || {}
data.function = data.function || WorkerFunctions.jsonIntegerSerialization
- executeWorkerFunction(data)
+
const res =
executeWorkerFunction(data)
debug === true && console.debug('This is the main thread ' + isMainThread)
debug === true && console.debug('This is the main thread ' + isMainThread)
- return
{ ok: 1 }
+ return
res
}
}
-export default new ThreadWorker(
you
rFunction)
+export default new ThreadWorker(
worke
rFunction)