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

path: fix POSIX path.resolve() perf regression by mscdex · Pull Request #38064 · nodejs/node · GitHub

/ node Public

path: fix POSIX path.resolve() perf regression - #38064

Closed
mscdex wants to merge 1 commit into
nodejs:masterfrom
mscdex:path-resolve-fix-perf-regression
Closed

path: fix POSIX path.resolve() perf regression#38064
mscdex wants to merge 1 commit into
nodejs:masterfrom
mscdex:path-resolve-fix-perf-regression

Conversation

mscdex commented Apr 3, 2021
edited
Loading

Copy link
Copy Markdown
Contributor

b0d5e03 introduced an unnecessary performance regression when using path.resolve() on POSIX systems. This commit both removes that regression in that situation and reduces the performance hit when path.posix.resolve() is used directly/indirectly on Windows systems.

The following benchmark results come from a Linux system:

After b0d5e03:

                                                                           confidence improvement accuracy (*)   (**)  (***)
path/resolve-posix.jsn=1000000 paths=''                                          ***    -54.27 %       ±0.94% ±1.26% ±1.65%
path/resolve-posix.jsn=1000000 paths='|'                                         ***    -54.97 %       ±1.07% ±1.43% ±1.86%
path/resolve-posix.jsn=1000000 paths='a/b/c/|../../..'                           ***    -34.18 %       ±0.86% ±1.15% ±1.50%
path/resolve-posix.jsn=1000000 paths='foo/bar|/tmp/file/|..|a/../subfile'        ***      8.11 %       ±1.55% ±2.07% ±2.71%

After the new implementation (basically caching the regexp):

                                                                           confidence improvement accuracy (*)   (**)  (***)
path/resolve-posix.jsn=1000000 paths=''                                          ***    -12.13 %       ±1.60% ±2.13% ±2.78%
path/resolve-posix.jsn=1000000 paths='|'                                         ***    -11.08 %       ±1.37% ±1.82% ±2.37%
path/resolve-posix.jsn=1000000 paths='a/b/c/|../../..'                           ***     -6.80 %       ±1.05% ±1.40% ±1.83%
path/resolve-posix.jsn=1000000 paths='foo/bar|/tmp/file/|..|a/../subfile'        ***      7.86 %       ±1.40% ±1.87% ±2.44%

After avoiding the transformations from b0d5e03 for POSIX systems (I'm not sure why there is a performance increase in this case, as I would have expected zero or close to zero change, but that's V8 for you):

                                                                           confidence improvement accuracy (*)   (**)  (***)
path/resolve-posix.jsn=1000000 paths=''                                          ***      9.13 %       ±1.16% ±1.54% ±2.01%
path/resolve-posix.jsn=1000000 paths='|'                                         ***      8.69 %       ±1.13% ±1.51% ±1.97%
path/resolve-posix.jsn=1000000 paths='a/b/c/|../../..'                           ***      4.82 %       ±0.91% ±1.21% ±1.58%
path/resolve-posix.jsn=1000000 paths='foo/bar|/tmp/file/|..|a/../subfile'        ***      8.62 %       ±1.24% ±1.66% ±2.17%

/cc @Trott @mcollina

mscdex added path Issues and PRs related to the path subsystem. performance Issues and PRs related to the performance of Node.js. labels Apr 3, 2021
nodejs-github-bot added the needs-ci PRs that need a full CI run. label Apr 3, 2021

This comment has been minimized.

mscdex force-pushed the path-resolve-fix-perf-regression branch from ed62b39 to 7b1cc3d Compare April 4, 2021 03:30

This comment has been minimized.

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

mscdex added the wip Issues and PRs that are still a work in progress. label Apr 4, 2021
mscdex force-pushed the path-resolve-fix-perf-regression branch from 7b1cc3d to 02deafb Compare April 4, 2021 16:24

Copy link
Copy Markdown
Collaborator

mscdex removed the wip Issues and PRs that are still a work in progress. label Apr 4, 2021

Copy link
Copy Markdown
Collaborator

Trott commented Apr 5, 2021

Copy link
Copy Markdown
Member

Fast-track to get this into the 15.14.0 release that's happening in another day-and-a-half or so?

Trott mentioned this pull request Apr 5, 2021
targos added the fast-track PRs that do not need to wait for 48 hours to land. label Apr 5, 2021

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Trott commented Apr 6, 2021

Copy link
Copy Markdown
Member

Landed in e38d62a.

Trott closed this Apr 6, 2021
Trott pushed a commit that referenced this pull request Apr 6, 2021
PR-URL: #38064
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
mscdex deleted the path-resolve-fix-perf-regression branch April 6, 2021 10:52
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

fast-track PRs that do not need to wait for 48 hours to land. needs-ci PRs that need a full CI run. path Issues and PRs related to the path subsystem. performance Issues and PRs related to the performance of Node.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants


Back | FazBrowse Home | New Git URL