node icon indicating copy to clipboard operation
node copied to clipboard

src: reduce unnecessary serialization of CLI options in C++

Open joyeecheung opened this issue 10 months ago • 10 comments

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.

joyeecheung avatar Apr 10 '24 16:04 joyeecheung

CI: https://ci.nodejs.org/job/node-test-pull-request/58279/

nodejs-github-bot avatar Apr 11 '24 12:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/58295/

nodejs-github-bot avatar Apr 11 '24 22:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/58315/

nodejs-github-bot avatar Apr 12 '24 12:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/58370/

nodejs-github-bot avatar Apr 14 '24 14:04 nodejs-github-bot

Rebased.

joyeecheung avatar Apr 16 '24 16:04 joyeecheung

CI: https://ci.nodejs.org/job/node-test-pull-request/58441/

nodejs-github-bot avatar Apr 16 '24 16:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/58477/

nodejs-github-bot avatar Apr 17 '24 21:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/58638/

nodejs-github-bot avatar Apr 23 '24 14:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/58722/

nodejs-github-bot avatar Apr 26 '24 17:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/58820/

nodejs-github-bot avatar Apr 30 '24 15:04 nodejs-github-bot

@jasnell @addaleax @anonrig @MoLow can I get a re-approval to land it?

joyeecheung avatar May 02 '24 13:05 joyeecheung

Landed in a480e52b6eff98bfa2183b60db38a954801a2a1b

nodejs-github-bot avatar May 02 '24 22:05 nodejs-github-bot