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

os: improve tmpdir performance #54709

Merged

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Sep 2, 2024

Improves the performance of tmpdir() by moving the implementation to C++ and reducing the communication count between C++ and JS.

Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1632/

                       confidence improvement accuracy (*)   (**)  (***)
os/tmpdir.js n=1000000        ***      6.27 %       ±0.22% ±0.29% ±0.38%

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. os Issues and PRs related to the os subsystem. labels Sep 2, 2024
@anonrig anonrig force-pushed the yagiz/improve-tmpdir-performance branch from 402ecf4 to 00cae50 Compare September 2, 2024 00:34
@RedYetiDev RedYetiDev added the needs-benchmark-ci PR that need a benchmark CI run. label Sep 2, 2024
Copy link

codecov bot commented Sep 2, 2024

Codecov Report

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

Project coverage is 87.90%. Comparing base (22ea302) to head (dfe018e).
Report is 162 commits behind head on main.

Files with missing lines Patch % Lines
src/node_credentials.cc 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #54709   +/-   ##
=======================================
  Coverage   87.89%   87.90%           
=======================================
  Files         651      651           
  Lines      183364   183375   +11     
  Branches    35714    35714           
=======================================
+ Hits       161171   161194   +23     
+ Misses      15465    15459    -6     
+ Partials     6728     6722    -6     
Files with missing lines Coverage Δ
lib/os.js 97.34% <100.00%> (-0.04%) ⬇️
src/node_credentials.cc 70.69% <94.11%> (+1.55%) ⬆️

... and 19 files with indirect coverage changes

@anonrig anonrig force-pushed the yagiz/improve-tmpdir-performance branch 3 times, most recently from 9e8c1be to 7b5f0c9 Compare September 2, 2024 02:07
@RedYetiDev

This comment was marked as outdated.

@anonrig

This comment was marked as outdated.

@anonrig anonrig force-pushed the yagiz/improve-tmpdir-performance branch 2 times, most recently from 2824662 to 111828d Compare September 5, 2024 14:56
@nodejs-github-bot

This comment was marked as outdated.

@anonrig
Copy link
Member Author

anonrig commented Sep 5, 2024

cc @nodejs/cpp-reviewers

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

@RafaelGSS RafaelGSS 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

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@anonrig anonrig force-pushed the yagiz/improve-tmpdir-performance branch from 111828d to dfe018e Compare September 10, 2024 15:03
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

lib/os.js Show resolved Hide resolved
@anonrig anonrig added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 11, 2024
@anonrig anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 11, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 11, 2024
@nodejs-github-bot nodejs-github-bot merged commit 1d2603b into nodejs:main Sep 11, 2024
56 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 1d2603b

aduh95 pushed a commit that referenced this pull request Sep 12, 2024
PR-URL: #54709
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
aduh95 pushed a commit that referenced this pull request Sep 13, 2024
PR-URL: #54709
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
aduh95 pushed a commit that referenced this pull request Sep 13, 2024
PR-URL: #54709
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Sep 16, 2024
@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 22, 2024
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
PR-URL: nodejs#54709
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
PR-URL: nodejs#54709
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
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. 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. needs-benchmark-ci PR that need a benchmark CI run. needs-ci PRs that need a full CI run. os Issues and PRs related to the os subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants