FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

module: improve `getPackageType` performance by dario-piotrowicz · Pull Request #57599 · nodejs/node · GitHub

/ node Public

module: improve getPackageType performance - #57599

Merged
nodejs-github-bot merged 3 commits into
nodejs:mainfrom
dario-piotrowicz:dario/add-getPackageType-module-binding
Apr 6, 2025
Merged

module: improve getPackageType performance#57599
nodejs-github-bot merged 3 commits into
nodejs:mainfrom
dario-piotrowicz:dario/add-getPackageType-module-binding

Conversation

Copy link
Copy Markdown
Member

packageJsonReader#getPackageType currently gets the whole package scope config from the C++ binding and then extracts its type field, my understanding is that this is wasteful (since the whole object needs to be serialized to cross the C++/JS boundary) and that gathering the type in C++ and returning only that would be more efficient, that's what I'm attempting to do in this PR 🙂 (I hope my C++ makes sense as I am pretty inexperienced with it 🤞)

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. typings labels Mar 23, 2025
dario-piotrowicz force-pushed the dario/add-getPackageType-module-binding branch from 759229d to 2c75280 Compare March 23, 2025 21:06
GeoffreyBooth requested a review from anonrig March 23, 2025 21:57

anonrig commented Mar 23, 2025

Copy link
Copy Markdown
Member

I'll review tomorrow morning.

codecov Bot commented Mar 23, 2025
edited
Loading

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.22%. Comparing base (1123585) to head (d242ecf).
Report is 70 commits behind head on main.

Files with missing lines Patch % Lines
src/node_modules.cc 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57599      +/-   ##
==========================================
- Coverage   90.22%   90.22%   -0.01%     
==========================================
  Files         630      630              
  Lines      185055   185064       +9     
  Branches    36216    36223       +7     
==========================================
- Hits       166975   166969       -6     
- Misses      11042    11043       +1     
- Partials     7038     7052      +14     
Files with missing lines Coverage Δ
lib/internal/modules/package_json_reader.js 99.39% <100.00%> (ø)
src/node_modules.h 100.00% <ø> (ø)
src/node_modules.cc 78.73% <91.66%> (-0.29%) ⬇️

... and 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

dario-piotrowicz force-pushed the dario/add-getPackageType-module-binding branch 3 times, most recently from 2052d4a to 3406431 Compare March 24, 2025 00:15
Comment thread src/node_modules.cc Outdated
Comment thread src/node_modules.cc Outdated
dario-piotrowicz force-pushed the dario/add-getPackageType-module-binding branch from 3406431 to 0670e6e Compare March 24, 2025 23:38
dario-piotrowicz force-pushed the dario/add-getPackageType-module-binding branch from 0670e6e to 46649e7 Compare March 24, 2025 23:45
Comment thread src/node_modules.cc Outdated
Co-authored-by: James M Snell <jasnell@gmail.com>

jasnell commented Mar 25, 2025

Copy link
Copy Markdown
Member

I think this should be ready to go but we're unable to run jenkins CI on it currently due to some ongoing maintenance, Once the CI system is unrestricted again we'll get the CI run scheduled so we can get this landed.

jasnell added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Mar 25, 2025

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

aduh95 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. labels Apr 6, 2025
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 6, 2025
nodejs-github-bot merged commit 8c25465 into nodejs:main Apr 6, 2025

Copy link
Copy Markdown
Collaborator

Landed in 8c25465

dario-piotrowicz deleted the dario/add-getPackageType-module-binding branch April 6, 2025 17:10
RafaelGSS pushed a commit that referenced this pull request May 1, 2025
PR-URL: #57599
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
PR-URL: #57599
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
aduh95 pushed a commit that referenced this pull request May 6, 2025
PR-URL: #57599
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
RafaelGSS pushed a commit that referenced this pull request May 14, 2025
PR-URL: #57599
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
aduh95 pushed a commit that referenced this pull request May 16, 2025
PR-URL: #57599
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57599
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
aduh95 pushed a commit that referenced this pull request May 19, 2025
PR-URL: #57599
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
ghost mentioned this pull request Jun 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 outstanding review comments, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. typings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL