Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: move more version computation code into node_metadata.cc #25115

Closed
wants to merge 3 commits into from

Conversation

@joyeecheung
Copy link
Member

commented Dec 18, 2018

src: move the declaration of http parser versions into node_metadata.h

Instead of putting them in node_internals.h.

src: move GetOpenSSLVersion into node_metadata.cc

Instead of implementing it in node_crypto.cc even though the only
place that needs it is the Metadata::Versions constructor.

src: initialize ICU version in per_process::metadata.versions

Instead of

  • Initialize the ICU versions in JS land after consulting
    internalBinding('config').hasIntl
  • Joining the version keys in C++
  • Splitting the keys in JS and call into C++ again to get the value for
    each of the keys

Do:

  • Guard the initialization code behind NODE_HAVE_I18N_SUPPORT
  • Do the initialization in C++ right after ICU data is loaded
  • Initialize each version directly using ICU functions/constants,
    and put them in per_process::metadata.versions. These will be
    copied into process.versions naturally later.
    This way, the initialization of the versions won't be called
    in worker threads again.
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
joyeecheung added 3 commits Dec 18, 2018
src: move GetOpenSSLVersion into node_metadata.cc
Instead of implementing it in node_crypto.cc even though the only
place that needs it is the `Metadata::Versions` constructor.
src: move the declaration of http parser versions into node_metadata.h
Instead of putting them in node_internals.h.
src: initialize ICU version in per_process::metadata.versions
Instead of

- Initialize the ICU versions in JS land after consulting
  internalBinding('config').hasIntl
- Joining the version keys in C++
- Splitting the keys in JS and call into C++ again to get the value for
  each of the keys

Do:

- Guard the initialization code behind `NODE_HAVE_I18N_SUPPORT`
- Do the initialization in C++ right after ICU data is loaded
- Initialize each version directly using ICU functions/constants,
  and put them in per_process::metadata.versions. These will be
  copied into `process.versions` naturally later.
  This way, the initialization of the versions won't be called
  in worker threads again.

@joyeecheung joyeecheung requested review from srl295 and addaleax Dec 18, 2018

@srl295
srl295 approved these changes Dec 18, 2018
src/node_i18n.cc Show resolved Hide resolved
@joyeecheung

This comment has been minimized.

Copy link
Member Author

commented Dec 18, 2018

@Trott

This comment has been minimized.

Copy link
Member

commented Dec 19, 2018

@joyeecheung

This comment has been minimized.

Copy link
Member Author

commented Dec 20, 2018

Landed in 3438f4b...263d137, thanks!

pull bot pushed a commit to SimenB/node that referenced this pull request Dec 20, 2018
src: move GetOpenSSLVersion into node_metadata.cc
Instead of implementing it in node_crypto.cc even though the only
place that needs it is the `Metadata::Versions` constructor.

PR-URL: nodejs#25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
pull bot pushed a commit to SimenB/node that referenced this pull request Dec 20, 2018
src: move the declaration of http parser versions into node_metadata.h
Instead of putting them in node_internals.h.

PR-URL: nodejs#25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
pull bot pushed a commit to SimenB/node that referenced this pull request Dec 20, 2018
src: initialize ICU version in per_process::metadata.versions
Instead of

- Initialize the ICU versions in JS land after consulting
  internalBinding('config').hasIntl
- Joining the version keys in C++
- Splitting the keys in JS and call into C++ again to get the value for
  each of the keys

Do:

- Guard the initialization code behind `NODE_HAVE_I18N_SUPPORT`
- Do the initialization in C++ right after ICU data is loaded
- Initialize each version directly using ICU functions/constants,
  and put them in per_process::metadata.versions. These will be
  copied into `process.versions` naturally later.
  This way, the initialization of the versions won't be called
  in worker threads again.

PR-URL: nodejs#25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins

This comment has been minimized.

Copy link
Member

commented Dec 25, 2018

This doesn't land cleanly on v11.x, should it be backported?

@targos targos added this to Backport requested in v11.x Dec 28, 2018

@addaleax

This comment has been minimized.

Copy link
Member

commented Jan 14, 2019

Applies cleanly now.

addaleax added a commit that referenced this pull request Jan 14, 2019
src: move GetOpenSSLVersion into node_metadata.cc
Instead of implementing it in node_crypto.cc even though the only
place that needs it is the `Metadata::Versions` constructor.

PR-URL: #25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Jan 14, 2019
src: move the declaration of http parser versions into node_metadata.h
Instead of putting them in node_internals.h.

PR-URL: #25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Jan 14, 2019
src: initialize ICU version in per_process::metadata.versions
Instead of

- Initialize the ICU versions in JS land after consulting
  internalBinding('config').hasIntl
- Joining the version keys in C++
- Splitting the keys in JS and call into C++ again to get the value for
  each of the keys

Do:

- Guard the initialization code behind `NODE_HAVE_I18N_SUPPORT`
- Do the initialization in C++ right after ICU data is loaded
- Initialize each version directly using ICU functions/constants,
  and put them in per_process::metadata.versions. These will be
  copied into `process.versions` naturally later.
  This way, the initialization of the versions won't be called
  in worker threads again.

PR-URL: #25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
refack added a commit to refack/node that referenced this pull request Jan 14, 2019
src: move GetOpenSSLVersion into node_metadata.cc
Instead of implementing it in node_crypto.cc even though the only
place that needs it is the `Metadata::Versions` constructor.

PR-URL: nodejs#25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
refack added a commit to refack/node that referenced this pull request Jan 14, 2019
src: move the declaration of http parser versions into node_metadata.h
Instead of putting them in node_internals.h.

PR-URL: nodejs#25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
refack added a commit to refack/node that referenced this pull request Jan 14, 2019
src: initialize ICU version in per_process::metadata.versions
Instead of

- Initialize the ICU versions in JS land after consulting
  internalBinding('config').hasIntl
- Joining the version keys in C++
- Splitting the keys in JS and call into C++ again to get the value for
  each of the keys

Do:

- Guard the initialization code behind `NODE_HAVE_I18N_SUPPORT`
- Do the initialization in C++ right after ICU data is loaded
- Initialize each version directly using ICU functions/constants,
  and put them in per_process::metadata.versions. These will be
  copied into `process.versions` naturally later.
  This way, the initialization of the versions won't be called
  in worker threads again.

PR-URL: nodejs#25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

@BridgeAR BridgeAR moved this from Backport requested to Backported in v11.x Jan 14, 2019

@BridgeAR BridgeAR referenced this pull request Jan 16, 2019
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
src: move GetOpenSSLVersion into node_metadata.cc
Instead of implementing it in node_crypto.cc even though the only
place that needs it is the `Metadata::Versions` constructor.

PR-URL: nodejs#25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
src: move the declaration of http parser versions into node_metadata.h
Instead of putting them in node_internals.h.

PR-URL: nodejs#25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
src: initialize ICU version in per_process::metadata.versions
Instead of

- Initialize the ICU versions in JS land after consulting
  internalBinding('config').hasIntl
- Joining the version keys in C++
- Splitting the keys in JS and call into C++ again to get the value for
  each of the keys

Do:

- Guard the initialization code behind `NODE_HAVE_I18N_SUPPORT`
- Do the initialization in C++ right after ICU data is loaded
- Initialize each version directly using ICU functions/constants,
  and put them in per_process::metadata.versions. These will be
  copied into `process.versions` naturally later.
  This way, the initialization of the versions won't be called
  in worker threads again.

PR-URL: nodejs#25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins referenced this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
10 participants
You can’t perform that action at this time.