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' into feature/task-functions
[poolifier.git]
/
benchmarks
/
versus-external-pools
/
functions
/
function-to-bench.js
diff --git
a/benchmarks/versus-external-pools/functions/function-to-bench.js
b/benchmarks/versus-external-pools/functions/function-to-bench.js
index b95f560f0807d7e9b3a638fe2106f609b5f368ca..ff13bc9ecd2ad04fb034bab8a622198ad748e10a 100644
(file)
--- a/
benchmarks/versus-external-pools/functions/function-to-bench.js
+++ b/
benchmarks/versus-external-pools/functions/function-to-bench.js
@@
-1,12
+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.
*/
* @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'
const TaskTypes = {
CPU_INTENSIVE: 'CPU_INTENSIVE',
IO_INTENSIVE: 'IO_INTENSIVE'