diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-10-29 15:15:36 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-11-05 23:07:04 +0100 |
commit | 973f324463a91721cc8a1158a5ab10ad0dd69019 (patch) | |
tree | a7664cbcc50c0fe7eced11fb20e49dc255abfe1e /benchmark | |
parent | f17e414dc4b5d80dd5b5c7ee7107659ec5ebeb1a (diff) | |
download | android-node-v8-973f324463a91721cc8a1158a5ab10ad0dd69019.tar.gz android-node-v8-973f324463a91721cc8a1158a5ab10ad0dd69019.tar.bz2 android-node-v8-973f324463a91721cc8a1158a5ab10ad0dd69019.zip |
child_process,cluster: allow using V8 serialization API
Add an `serialization` option that allows child process IPC to
use the (typically more powerful) V8 serialization API.
Fixes: https://github.com/nodejs/node/issues/10965
PR-URL: https://github.com/nodejs/node/pull/30162
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/cluster/echo.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/benchmark/cluster/echo.js b/benchmark/cluster/echo.js index 73c5971cd4..152f2c42f1 100644 --- a/benchmark/cluster/echo.js +++ b/benchmark/cluster/echo.js @@ -7,16 +7,25 @@ if (cluster.isMaster) { workers: [1], payload: ['string', 'object'], sendsPerBroadcast: [1, 10], + serialization: ['json', 'advanced'], n: [1e5] }); - function main({ n, workers, sendsPerBroadcast, payload }) { + function main({ + n, + workers, + sendsPerBroadcast, + payload, + serialization + }) { const expectedPerBroadcast = sendsPerBroadcast * workers; var readies = 0; var broadcasts = 0; var msgCount = 0; var data; + cluster.settings.serialization = serialization; + switch (payload) { case 'string': data = 'hello world!'; |