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: refactor http parser binding initialization #54276

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

joyeecheung
Copy link
Member

  • Use the per-isolate template to build constants and functions which is faster
  • Use Array::New() with prebuilt vectors which is faster
  • Register external references so the binding can be included in the snapshot

- Use the per-isolate template to build constants and functions
  which is faster
- Use Array::New() with prebuilt vectors which is faster
- Register external references so the binding can be included
  in the snapshot
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. http_parser Issues and PRs related to the HTTP Parser dependency or the http_parser binding. needs-ci PRs that need a full CI run. labels Aug 8, 2024
Copy link

codecov bot commented Aug 9, 2024

Codecov Report

Attention: Patch coverage is 94.79167% with 5 lines in your changes missing coverage. Please review.

Project coverage is 87.10%. Comparing base (9e6c526) to head (c13202c).
Report is 451 commits behind head on main.

Files with missing lines Patch % Lines
src/node_http_parser.cc 94.79% 1 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54276      +/-   ##
==========================================
- Coverage   87.10%   87.10%   -0.01%     
==========================================
  Files         647      647              
  Lines      181754   181782      +28     
  Branches    34880    34887       +7     
==========================================
+ Hits       158323   158346      +23     
+ Misses      16742    16736       -6     
- Partials     6689     6700      +11     
Files with missing lines Coverage Δ
src/node_external_reference.h 100.00% <ø> (ø)
src/node_http_parser.cc 83.11% <94.79%> (+0.09%) ⬆️

... and 24 files with indirect coverage changes

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

Copy link
Member

@ronag ronag left a comment

Choose a reason for hiding this comment

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

Just a thought. Could we use a wasm build similar to undici?

@mcollina
Copy link
Member

I'm not sure wasm is available on all platforms.

@mcollina mcollina added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 10, 2024
@ronag
Copy link
Member

ronag commented Aug 10, 2024

Your mean fetch (undici) doesn't work or all platforms?

@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 Aug 10, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/54276
✔  Done loading data for nodejs/node/pull/54276
----------------------------------- PR info ------------------------------------
Title      src: refactor http parser binding initialization (#54276)
Author     Joyee Cheung <[email protected]> (@joyeecheung)
Branch     joyeecheung:http-parser-binding -> nodejs:main
Labels     c++, http_parser, needs-ci
Commits    1
 - src: refactor http parser binding initialization
Committers 1
 - Joyee Cheung <[email protected]>
PR-URL: https:/nodejs/node/pull/54276
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https:/nodejs/node/pull/54276
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Thu, 08 Aug 2024 22:22:21 GMT
   ✔  Approvals: 5
   ✔  - Michaël Zasso (@targos) (TSC): https:/nodejs/node/pull/54276#pullrequestreview-2229382852
   ✔  - Matteo Collina (@mcollina) (TSC): https:/nodejs/node/pull/54276#pullrequestreview-2229715600
   ✔  - Paolo Insogna (@ShogunPanda) (TSC): https:/nodejs/node/pull/54276#pullrequestreview-2229828935
   ✔  - Anna Henningsen (@addaleax): https:/nodejs/node/pull/54276#pullrequestreview-2231440372
   ✔  - Robert Nagy (@ronag) (TSC): https:/nodejs/node/pull/54276#pullrequestreview-2231464359
   ✔  Last GitHub CI successful
   ✘  No Jenkins CI runs detected
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https:/nodejs/node/actions/runs/10334911205

@mcollina
Copy link
Member

Your mean fetch (undici) doesn't work or all platforms?

I have a rough recall of this being a problem, or at least with some ./configure flags.

@joyeecheung joyeecheung added request-ci Add this label to start a Jenkins CI on a PR. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Aug 12, 2024
@joyeecheung
Copy link
Member Author

I'm not sure wasm is available on all platforms.

I am guessing by that you mean wasm cannot be built on all platforms (not that a pre-built one cannot be loaded on all platforms). For the parsing on the server side I think there were some experiments with this using https:/ShogunPanda/milo @ShogunPanda knows more.

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 12, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@mcollina
Copy link
Member

I am guessing by that you mean wasm cannot be built on all platforms (not that a pre-built one cannot be loaded on all platforms).

@joyeecheung ah right! That was the reason.

@joyeecheung joyeecheung added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 14, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 14, 2024
@nodejs-github-bot nodejs-github-bot merged commit 503cf16 into nodejs:main Aug 14, 2024
71 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 503cf16

RafaelGSS pushed a commit that referenced this pull request Aug 19, 2024
- Use the per-isolate template to build constants and functions
  which is faster
- Use Array::New() with prebuilt vectors which is faster
- Register external references so the binding can be included
  in the snapshot

PR-URL: #54276
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Aug 19, 2024
RafaelGSS pushed a commit that referenced this pull request Aug 21, 2024
- Use the per-isolate template to build constants and functions
  which is faster
- Use Array::New() with prebuilt vectors which is faster
- Register external references so the binding can be included
  in the snapshot

PR-URL: #54276
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
@targos targos added the dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. http_parser Issues and PRs related to the HTTP Parser dependency or the http_parser binding. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants