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: be more generational GC friendly #56767

Merged
merged 2 commits into from
Jan 31, 2025
Merged

Conversation

ywave620
Copy link
Contributor

@ywave620 ywave620 commented Jan 26, 2025

Avoid any potential ref to Buffer in new generation from old generation. Otherwise, the lightweight Minor GC could not collect Buffer, as a result, the heavy Major GC may be invoked more frequently

Similar tricks are used in Writable and Readable

buffered[i++] = null;

buf[idx++] = null;

Avoid any potential ref to Buffer in new generation
from old generation
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net

Sorry, something went wrong.

@nodejs-github-bot nodejs-github-bot added http Issues or PRs related to the http subsystem. needs-ci PRs that need a full CI run. labels Jan 26, 2025
Copy link

codecov bot commented Jan 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.21%. Comparing base (7119303) to head (e906371).
Report is 67 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56767      +/-   ##
==========================================
- Coverage   89.22%   89.21%   -0.01%     
==========================================
  Files         662      663       +1     
  Lines      192125   191976     -149     
  Branches    36972    36924      -48     
==========================================
- Hits       171421   171273     -148     
- Misses      13543    13566      +23     
+ Partials     7161     7137      -24     
Files with missing lines Coverage Δ
lib/_http_outgoing.js 95.24% <100.00%> (+<0.01%) ⬆️

... and 57 files with indirect coverage changes

@mcollina
Copy link
Member

tests are failing

@legendecas
Copy link
Member

Failed tests should be fixed by #56768. But the linter complaints shall be addressed.

Fix lint
@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 27, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 27, 2025
@nodejs-github-bot
Copy link
Collaborator

@ywave620
Copy link
Contributor Author

@legendecas CI is green, please take a look

@ywave620
Copy link
Contributor Author

@mcollina @legendecas PTAL

@Flarna Flarna added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 31, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 31, 2025
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@mcollina mcollina added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 31, 2025
@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 Jan 31, 2025
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/56767
✔  Done loading data for nodejs/node/pull/56767
----------------------------------- PR info ------------------------------------
Title      http: be more generational GC friendly (#56767)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     ywave620:gc -> nodejs:main
Labels     http, needs-ci
Commits    2
 - http: be more generational GC friendly
 - http: be more generational GC friendly
Committers 1
 - rogertyang <rogertyang@tencent.com>
PR-URL: https://github.com/nodejs/node/pull/56767
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/56767
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Sun, 26 Jan 2025 03:45:19 GMT
   ✔  Approvals: 3
   ✔  - Paolo Insogna (@ShogunPanda) (TSC): https://github.com/nodejs/node/pull/56767#pullrequestreview-2585713986
   ✔  - Gerhard Stöbich (@Flarna): https://github.com/nodejs/node/pull/56767#pullrequestreview-2585725660
   ✔  - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/56767#pullrequestreview-2586744900
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2025-01-31T11:59:13Z: https://ci.nodejs.org/job/node-test-pull-request/64870/
- Querying data for job/node-test-pull-request/64870/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 56767
From https://github.com/nodejs/node
 * branch                  refs/pull/56767/merge -> FETCH_HEAD
✔  Fetched commits as 261624bb06f4..e90637178b8c
--------------------------------------------------------------------------------
[main 26d1d639c6] http: be more generational GC friendly
 Author: rogertyang <rogertyang@tencent.com>
 Date: Sun Jan 26 11:40:16 2025 +0800
 1 file changed, 2 insertions(+)
[main d766009343] http: be more generational GC friendly
 Author: rogertyang <rogertyang@tencent.com>
 Date: Mon Jan 27 11:10:10 2025 +0800
 1 file changed, 2 insertions(+), 2 deletions(-)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
Rebasing (2/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
http: be more generational GC friendly

Avoid any potential ref to Buffer in new generation
from old generation

PR-URL: #56767
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>

[detached HEAD bf07283fc5] http: be more generational GC friendly
Author: rogertyang <rogertyang@tencent.com>
Date: Sun Jan 26 11:40:16 2025 +0800
1 file changed, 2 insertions(+)
Rebasing (3/4)
Rebasing (4/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
http: be more generational GC friendly

Fix lint

PR-URL: #56767
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>

[detached HEAD bbc484a34c] http: be more generational GC friendly
Author: rogertyang <rogertyang@tencent.com>
Date: Mon Jan 27 11:10:10 2025 +0800
1 file changed, 2 insertions(+), 2 deletions(-)
Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/13075397913

@richardlau richardlau added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jan 31, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 31, 2025
@nodejs-github-bot nodejs-github-bot merged commit ba4587c into nodejs:main Jan 31, 2025
77 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in ba4587c

targos pushed a commit that referenced this pull request Feb 2, 2025
Avoid any potential ref to Buffer in new generation
from old generation

PR-URL: #56767
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. http Issues or PRs related to the http subsystem. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants