node
node copied to clipboard
src: reduce unnecessary serialization of CLI options in C++
In this patch we split the serialization routine into two different routines: getCLIOptionsValues()
for only serializing the key-value pairs and getCLIOptionsInfo()
for getting additional information such as help text etc. The former is used a lot more frequently than the latter, which is only used for generating --help
and building process.allowedNodeEnvironmentFlags
.
getCLIOptionsValues()
also adds --no-
entries for boolean options so there is no need to special case in the JS land.
This patch also refactors the option serialization routines to use v8::Object constructor that takes key-value pairs in one go to avoid calling Map::Set or Object::Set repeatedly which can go up to a patched prototype.
CI: https://ci.nodejs.org/job/node-test-pull-request/58279/
CI: https://ci.nodejs.org/job/node-test-pull-request/58295/
CI: https://ci.nodejs.org/job/node-test-pull-request/58315/
CI: https://ci.nodejs.org/job/node-test-pull-request/58370/
Rebased.
CI: https://ci.nodejs.org/job/node-test-pull-request/58441/
CI: https://ci.nodejs.org/job/node-test-pull-request/58477/
CI: https://ci.nodejs.org/job/node-test-pull-request/58638/
CI: https://ci.nodejs.org/job/node-test-pull-request/58722/
CI: https://ci.nodejs.org/job/node-test-pull-request/58820/
@jasnell @addaleax @anonrig @MoLow can I get a re-approval to land it?
Landed in a480e52b6eff98bfa2183b60db38a954801a2a1b