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

module: execute --import sequentially #50474

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Oct 30, 2023

Fixes: #50427

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. labels Oct 30, 2023
doc/api/cli.md Outdated Show resolved Hide resolved
@Uzlopak
Copy link
Contributor

Uzlopak commented Oct 30, 2023

If one of the modules has a top level await you have to load the modules in order, but if not you could load them unordered.
So it is a fix which can have performance regressions?

@JakobJingleheimer
Copy link
Contributor

So it is a fix which can have performance regressions?

I think it's more accurate to say this has performance implications.

Copy link
Member

@anonrig anonrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm -1 on this. Is it really worth preserving the order when sequential awaiting has a huge impact on performance?

@aduh95
Copy link
Contributor Author

aduh95 commented Oct 30, 2023

has a huge impact on performance?

You say huge, how big are we talking about?

@anonrig
Copy link
Member

anonrig commented Oct 30, 2023

has a huge impact on performance?

You say huge, how big are we talking about?

That's a good question that deserves a benchmark 👍

@anonrig anonrig added the needs-benchmark-ci PR that need a benchmark CI run. label Oct 30, 2023
@GeoffreyBooth
Copy link
Member

I’m -1 on this. Is it really worth preserving the order when sequential awaiting has a huge impact on performance?

Yes, because the current implementation doesn’t achieve the desired effect. If the first --import registers hooks to handle TypeScript, the second --import of a TypeScript file should work. It doesn’t matter how much slower it becomes; the current behavior is broken.

If the user wants parallelized loading, they can put a bunch of import statements into a file and --import that.

@anonrig anonrig dismissed their stale review October 30, 2023 16:06

Convinced by @GeoffreyBooth's comments

@aduh95
Copy link
Contributor Author

aduh95 commented Oct 30, 2023

has a huge impact on performance?

You say huge, how big are we talking about?

That's a good question that deserves a benchmark 👍

I don't think it's that good of a question, it was mostly rhetorical. The change has literally no impact on folks who are not using --import, and the impact of folks using lots of --import will depend a lot on what's inside the imported modules. I don't think we can come up with a benchmark showing regressions unless it's very artificial (i.e. no real-world use case would be impacted), but happy to be proven wrong.

--import is an experimental API, performance consideration is not a strong enough reason to block that PR from landing IMO (unless you're saying it will slow down users who are not using it, but I don't think it's the case).

@GeoffreyBooth GeoffreyBooth removed the needs-benchmark-ci PR that need a benchmark CI run. label Oct 30, 2023
@giltayar
Copy link
Contributor

giltayar commented Oct 31, 2023

I’m -1 on this. Is it really worth preserving the order when sequential awaiting has a huge impact on performance?

@GeoffreyBooth supplied one reason it has to be sequential. Another reason is the "loader registration use case" as outlined in #50427 (and which was how this bug was found), where if the user writes --import loader-a --import loader-b then they want to register the loaders to be registered in that specific order because loader chain order is important: some loaders have to be chained in just the right order.

Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Oct 31, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 31, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 31, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Nov 1, 2023
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/50474
✔  Done loading data for nodejs/node/pull/50474
----------------------------------- PR info ------------------------------------
Title      module: execute `--import` sequentially (#50474)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     aduh95:--import-serial -> nodejs:main
Labels     process, author ready, needs-ci, commit-queue-squash
Commits    2
 - module: execute `--import` sequentially
 - Apply suggestions from code review
Committers 2
 - Antoine du Hamel 
 - GitHub 
PR-URL: https://github.com/nodejs/node/pull/50474
Fixes: https://github.com/nodejs/node/issues/50427
Reviewed-By: Jacob Smith 
Reviewed-By: Michaël Zasso 
Reviewed-By: Moshe Atlow 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/50474
Fixes: https://github.com/nodejs/node/issues/50427
Reviewed-By: Jacob Smith 
Reviewed-By: Michaël Zasso 
Reviewed-By: Moshe Atlow 
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last approving review:
   ⚠  - Apply suggestions from code review
   ℹ  This PR was created on Mon, 30 Oct 2023 10:21:43 GMT
   ✔  Approvals: 3
   ✔  - Jacob Smith (@JakobJingleheimer): https://github.com/nodejs/node/pull/50474#pullrequestreview-1703780454
   ✔  - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/50474#pullrequestreview-1703829531
   ✔  - Moshe Atlow (@MoLow) (TSC): https://github.com/nodejs/node/pull/50474#pullrequestreview-1705908328
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2023-11-01T05:42:53Z: https://ci.nodejs.org/job/node-test-pull-request/55377/
- Querying data for job/node-test-pull-request/55377/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/6718540805

@aduh95 aduh95 added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Nov 1, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 1, 2023
@nodejs-github-bot nodejs-github-bot merged commit a3e09b3 into nodejs:main Nov 1, 2023
65 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in a3e09b3

@aduh95 aduh95 deleted the --import-serial branch November 1, 2023 12:50
alexfernandez pushed a commit to alexfernandez/node that referenced this pull request Nov 1, 2023
PR-URL: nodejs#50474
Fixes: nodejs#50427
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
anonrig pushed a commit to anonrig/node that referenced this pull request Nov 9, 2023
PR-URL: nodejs#50474
Fixes: nodejs#50427
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
targos pushed a commit that referenced this pull request Nov 11, 2023
PR-URL: #50474
Fixes: #50427
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
targos pushed a commit that referenced this pull request Nov 14, 2023
PR-URL: #50474
Fixes: #50427
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
PR-URL: #50474
Fixes: #50427
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
@UlisesGascon UlisesGascon mentioned this pull request Dec 12, 2023
robin-maki pushed a commit to penxle/withglyph that referenced this pull request Jan 26, 2024
nodejs/node#50474 로 수정된 nodejs `--import` 실행 순서 버그를 코드베이스에 반영함
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--import order is wrong when one of the modules imports a module
10 participants