repositories
/
poolifier.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
565f811219cbccea2cdb1991b1c8a9a337fa9618
[poolifier.git]
/
benchmarks
/
versus-external-pools
/
functions
/
function-to-bench.js
1
module
.
exports
=
function
(
data
) {
2
if
(
data
.
taskType
===
'CPU_INTENSIVE'
) {
3
// CPU intensive task
4
for
(
let
i
=
0
;
i
<
5000
;
i
++) {
5
const
o
= {
6
a
:
i
7
}
8
JSON
.
stringify
(
o
)
9
}
10
return
{
ok
:
1
}
11
}
else
{
12
throw new
Error
(
'Please specify the task type'
)
13
}
14
}