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

http: explain the unused argument in IncomingMessage._read #37275

Closed

Conversation

Ayase-252
Copy link
Member

It removes parameter n of IncomingMessage since it is not used in the function body.

@nodejs-github-bot nodejs-github-bot added the http Issues or PRs related to the http subsystem. label Feb 8, 2021
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

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

LGTM!

Note to whoever lands this: there's a typo in the commit message that needs fixing (ImcomingMessage -> IncomingMessage).

@RaisinTen
Copy link
Contributor

cc @nodejs/http

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

This is needed for performance reason. This adds an additional frame in a very hot code path.
See also: https://bugs.chromium.org/p/v8/issues/detail?id=10201

I'm -1 (strongly). This might be removed in the future.

@Ayase-252
Copy link
Member Author

@mcollina Thank you for giving the underlying performance consideration here. By giving that, this refactor should not be merged certainly.

Should we add a comment here to explain the unused parameter?

@mcollina
Copy link
Member

mcollina commented Feb 8, 2021

Yes please!

@Ayase-252 Ayase-252 force-pushed the refactor/remove-unused-parameter branch from 00ec72b to 3bc6cfa Compare February 8, 2021 22:28
@Ayase-252 Ayase-252 changed the title http: remove unused parameter in _read of ImcomingMessage http: explain the unused argument in IncomingMessage._read Feb 8, 2021
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@ronag
Copy link
Member

ronag commented Feb 9, 2021

FWIW this might not be a problem anymore after v8 8.9 https://v8.dev/blog/v8-release-89

@nodejs-github-bot
Copy link
Collaborator

@Ayase-252
Copy link
Member Author

@ronag It' awesome. I added a NOTE comment as remind of the posiblity of improvement when v8 engine is upgraded to v8.9 in the future.

@nodejs-github-bot
Copy link
Collaborator

@dnlup
Copy link
Contributor

dnlup commented Feb 10, 2021

The failures seem related to memory exhaustion during compilation, or nothing related to these changes anyway. I am going to land this.

dnlup pushed a commit that referenced this pull request Feb 10, 2021
PR-URL: #37275
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
dnlup pushed a commit that referenced this pull request Feb 10, 2021
PR-URL: #37275
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@dnlup
Copy link
Contributor

dnlup commented Feb 10, 2021

Landed in ad3ebed...9d2125e

@dnlup dnlup closed this Feb 10, 2021
@RaisinTen
Copy link
Contributor

RaisinTen commented Feb 10, 2021

@dnlup should the commits be squashed into a single commit before landing? The commits seem to be addressing the same task of throwing light on the unused argument.

@dnlup
Copy link
Contributor

dnlup commented Feb 10, 2021

@RaisinTen I have seen landing both multiple commits and squashed commits in other PRs. In this case, I thought keeping the last two commits would have given a bit more context (perhaps making a mistake?)

@RaisinTen
Copy link
Contributor

@dnlup I was considering a squash because the onboarding documentation says this:

node/onboarding.md

Lines 198 to 200 in 9d2125e

Commits in one PR that belong to one logical change should
be squashed. It is rarely the case in onboarding exercises, so this
needs to be pointed out separately during the onboarding.

@dnlup
Copy link
Contributor

dnlup commented Feb 10, 2021

@dnlup I was considering a squash because the onboarding documentation says this:

node/onboarding.md

Lines 198 to 200 in 9d2125e

Commits in one PR that belong to one logical change should
be squashed. It is rarely the case in onboarding exercises, so this
needs to be pointed out separately during the onboarding.

@RaisinTen I see. It makes sense. However, maybe squashing now would be too much hassle? (Reverting then landing again, I guess). Thanks for pointing that out, though.

@Ayase-252 Ayase-252 deleted the refactor/remove-unused-parameter branch February 10, 2021 13:43
danielleadams pushed a commit that referenced this pull request Feb 16, 2021
PR-URL: #37275
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
danielleadams pushed a commit that referenced this pull request Feb 16, 2021
PR-URL: #37275
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This was referenced Feb 16, 2021
targos pushed a commit that referenced this pull request May 1, 2021
PR-URL: #37275
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos pushed a commit that referenced this pull request May 1, 2021
PR-URL: #37275
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@danielleadams danielleadams mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants