Skip to content

path: remove StringPrototypeCharCodeAt from some methods of posix - #54668

Open
HBSPS wants to merge 1 commit into
nodejs:mainfrom
HBSPS:path
Open

path: remove StringPrototypeCharCodeAt from some methods of posix#54668
HBSPS wants to merge 1 commit into
nodejs:mainfrom
HBSPS:path

Conversation

@HBSPS

Copy link
Copy Markdown
Member
 confidence improvement accuracy (*) (**) (***)
path/normalize-posix.js n=100000 path='.' *** 7.77 % ±1.84% ±2.44% ±3.18%
path/normalize-posix.js n=100000 path='' 3.09 % ±4.67% ±6.27% ±8.28%
path/normalize-posix.js n=100000 path='/../' * 2.57 % ±1.97% ±2.62% ±3.41%
path/normalize-posix.js n=100000 path='/foo' * 2.54 % ±1.94% ±2.57% ±3.35%
path/normalize-posix.js n=100000 path='/foo/bar' 1.30 % ±1.99% ±2.65% ±3.45%
path/normalize-posix.js n=100000 path='/foo/bar//baz/asdf/quux/..' 0.70 % ±1.78% ±2.37% ±3.08%
path/parse-posix.js n=100000 path='' -0.82 % ±2.25% ±2.99% ±3.90%
path/parse-posix.js n=100000 path='/' ** 2.35 % ±1.62% ±2.16% ±2.81%
path/parse-posix.js n=100000 path='/foo' * 2.01 % ±1.95% ±2.59% ±3.37%
path/parse-posix.js n=100000 path='/foo/bar.baz' ** 1.66 % ±1.22% ±1.62% ±2.11%
path/parse-posix.js n=100000 path='/foo/bar/baz/asdf/.quux' 0.74 % ±1.46% ±1.95% ±2.53%
path/parse-posix.js n=100000 path='foo/.bar.baz' -0.93 % ±1.32% ±1.76% ±2.29%
path/parse-posix.js n=100000 path='foo/bar' 1.32 % ±1.36% ±1.82% ±2.37%
path/resolve-posix.js n=100000 paths='' 1.57 % ±2.29% ±3.06% ±4.04%
path/resolve-posix.js n=100000 paths='|' ** 1.10 % ±0.78% ±1.03% ±1.34%
path/resolve-posix.js n=100000 paths='a/b/c/|../../..' 0.47 % ±0.71% ±0.95% ±1.23%
path/resolve-posix.js n=100000 paths='foo/bar|/tmp/file/|..|a/../subfile' -0.00 % ±1.20% ±1.60% ±2.08%

Refs: #54546

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. path Issues and PRs related to the path subsystem. labels Aug 31, 2024
@avivkelleravivkeller added the needs-benchmark-ci PR that need a benchmark CI run. label Aug 31, 2024

@avivkelleravivkeller 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.

IMO the commit message / title is a bit misleading, as this isn't removing the primordial everywhere, maybe reword?

Comment threadlib/path.js Outdated
@@ -1543,8 +1540,8 @@ const posix = {

// Get non-dir info
for (; i >= start; --i) {
const code = StringPrototypeCharCodeAt(path, i);
if (code === CHAR_FORWARD_SLASH) {
const code = path[i];

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.

Maybe rename this variable to char?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I applied it!

@HBSPSHBSPS changed the title path: remove StringPrototypeCharCodeAt from lib/pathpath: remove StringPrototypeCharCodeAt from some methods of posixAug 31, 2024
@codecov

codecovBot commented Aug 31, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.54%. Comparing base (15bdf38) to head (554270d).
⚠️ Report is 1988 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #54668 +/- ##
==========================================
+ Coverage 88.53% 88.54% +0.01% 
==========================================
Files 703 703 Lines 208598 208595 -3 Branches 40227 40235 +8 ==========================================
+ Hits 184674 184700 +26 + Misses 15951 15908 -43 - Partials 7973 7987 +14 
Files with missing linesCoverage Δ
lib/path.js97.48% <100.00%> (-0.01%)⬇️

... and 31 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.

@lpincalpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 31, 2024
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 31, 2024
@nodejs-github-bot

nodejs-github-bot commented Aug 31, 2024

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/61752/

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

Results
 confidence improvement accuracy (*) (**) (***)
path/basename-posix.js n=100000 pathext='' 0.87 % ±1.40% ±1.86% ±2.43%
path/basename-posix.js n=100000 pathext='/' -0.54 % ±0.99% ±1.32% ±1.72%
path/basename-posix.js n=100000 pathext='/foo' 0.10 % ±1.00% ±1.33% ±1.73%
path/basename-posix.js n=100000 pathext='/foo/.bar.baz' 1.96 % ±2.36% ±3.17% ±4.17%
path/basename-posix.js n=100000 pathext='/foo/.bar.baz|.baz' 1.29 % ±2.28% ±3.04% ±3.96%
path/basename-posix.js n=100000 pathext='/foo/bar/baz/asdf/quux.html' 0.93 % ±1.70% ±2.27% ±2.97%
path/basename-posix.js n=100000 pathext='/foo/bar/baz/asdf/quux.html|.html' -1.84 % ±2.77% ±3.69% ±4.82%
path/basename-posix.js n=100000 pathext='foo' -0.41 % ±0.86% ±1.14% ±1.49%
path/basename-posix.js n=100000 pathext='foo/bar.' -0.26 % ±0.56% ±0.74% ±0.96%
path/basename-posix.js n=100000 pathext='foo/bar.|.' -0.59 % ±1.95% ±2.59% ±3.38%
path/basename-win32.js n=100000 pathext='' 0.29 % ±1.86% ±2.49% ±3.25%
path/basename-win32.js n=100000 pathext='\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux.html' 0.77 % ±2.20% ±2.93% ±3.82%
path/basename-win32.js n=100000 pathext='\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux.html|.html' 1.60 % ±3.41% ±4.54% ±5.91%
path/basename-win32.js n=100000 pathext='C:\\\\' 0.72 % ±1.16% ±1.55% ±2.04%
path/basename-win32.js n=100000 pathext='C:\\\\foo' 0.25 % ±0.61% ±0.81% ±1.05%
path/basename-win32.js n=100000 pathext='D:\\\\foo\\\\.bar.baz' -0.54 % ±1.71% ±2.27% ±2.96%
path/basename-win32.js n=100000 pathext='E:\\\\foo\\\\.bar.baz|.baz' * -2.18 % ±1.82% ±2.45% ±3.24%
path/basename-win32.js n=100000 pathext='foo' -0.20 % ±0.97% ±1.29% ±1.68%
path/basename-win32.js n=100000 pathext='foo\\\\bar.' -0.57 % ±1.32% ±1.76% ±2.30%
path/basename-win32.js n=100000 pathext='foo\\\\bar.|.' -0.70 % ±2.54% ±3.39% ±4.41%
path/dirname-posix.js n=100000 path='' -0.00 % ±1.67% ±2.23% ±2.90%
path/dirname-posix.js n=100000 path='/' -0.35 % ±1.02% ±1.36% ±1.78%
path/dirname-posix.js n=100000 path='/foo' -0.93 % ±1.96% ±2.62% ±3.44%
path/dirname-posix.js n=100000 path='/foo/bar' -0.17 % ±0.79% ±1.05% ±1.37%
path/dirname-posix.js n=100000 path='/foo/bar/baz/asdf/quux' -0.54 % ±1.05% ±1.40% ±1.82%
path/dirname-posix.js n=100000 path='foo' -0.08 % ±1.57% ±2.09% ±2.72%
path/dirname-posix.js n=100000 path='foo/bar' -0.34 % ±0.89% ±1.19% ±1.55%
path/dirname-win32.js n=100000 path='' -0.68 % ±0.99% ±1.32% ±1.72%
path/dirname-win32.js n=100000 path='\\\\' 1.61 % ±2.17% ±2.92% ±3.85%
path/dirname-win32.js n=100000 path='\\\\foo' -0.62 % ±0.72% ±0.96% ±1.25%
path/dirname-win32.js n=100000 path='C:\\\\foo\\\\bar' -0.30 % ±2.13% ±2.84% ±3.70%
path/dirname-win32.js n=100000 path='D:\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux' 0.48 % ±2.28% ±3.03% ±3.94%
path/dirname-win32.js n=100000 path='foo' 0.89 % ±1.60% ±2.14% ±2.80%
path/dirname-win32.js n=100000 path='foo\\\\bar' -0.84 % ±0.98% ±1.31% ±1.70%
path/extname-posix.js n=100000 path='' -0.61 % ±2.04% ±2.72% ±3.56%
path/extname-posix.js n=100000 path='/' -0.25 % ±1.98% ±2.65% ±3.48%
path/extname-posix.js n=100000 path='/foo' 1.16 % ±1.56% ±2.08% ±2.72%
path/extname-posix.js n=100000 path='/foo/bar/baz/asdf/quux.foobarbazasdfquux' 2.47 % ±2.60% ±3.47% ±4.54%
path/extname-posix.js n=100000 path='/foo/bar/baz/asdf/quux' 0.76 % ±1.88% ±2.50% ±3.26%
path/extname-posix.js n=100000 path='foo/.bar.baz' 0.41 % ±0.99% ±1.31% ±1.71%
path/extname-posix.js n=100000 path='foo/bar/...baz.quux' -0.35 % ±1.85% ±2.49% ±3.28%
path/extname-posix.js n=100000 path='foo/bar/..baz.quux' -0.47 % ±1.35% ±1.82% ±2.39%
path/extname-posix.js n=100000 path='index.html' ** 1.00 % ±0.60% ±0.80% ±1.04%
path/extname-posix.js n=100000 path='index' *** -5.27 % ±1.75% ±2.34% ±3.05%
path/extname-win32.js n=100000 path='' -1.48 % ±2.48% ±3.29% ±4.29%
path/extname-win32.js n=100000 path='\\\\' 0.06 % ±1.80% ±2.40% ±3.13%
path/extname-win32.js n=100000 path='\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux.foobarbazasdfquux' 0.51 % ±2.10% ±2.80% ±3.64%
path/extname-win32.js n=100000 path='C:\\\\foo' -0.72 % ±1.56% ±2.08% ±2.72%
path/extname-win32.js n=100000 path='D:\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux' * -0.52 % ±0.46% ±0.62% ±0.80%
path/extname-win32.js n=100000 path='foo\\\\.bar.baz' * 2.30 % ±2.03% ±2.71% ±3.57%
path/extname-win32.js n=100000 path='foo\\\\bar\\\\...baz.quux' -0.10 % ±1.98% ±2.64% ±3.44%
path/extname-win32.js n=100000 path='foo\\\\bar\\\\..baz.quux' 0.11 % ±0.58% ±0.77% ±1.00%
path/extname-win32.js n=100000 path='index.html' -0.06 % ±0.96% ±1.28% ±1.67%
path/extname-win32.js n=100000 path='index' 0.37 % ±1.52% ±2.03% ±2.65%
path/format-posix.js n=1000000 props='/|/home/user/dir|index.html|.html|index' -0.14 % ±1.22% ±1.62% ±2.11%
path/format-win32.js n=1000000 props='C:\\\\|C:\\\\path\\\\dir|index.html|.html|index' 0.69 % ±0.74% ±0.98% ±1.28%
path/isAbsolute-posix.js n=100000 path='.' -1.76 % ±2.27% ±3.04% ±4.00%
path/isAbsolute-posix.js n=100000 path='' -2.44 % ±3.69% ±4.91% ±6.39%
path/isAbsolute-posix.js n=100000 path='/baz/..' 0.18 % ±1.57% ±2.09% ±2.73%
path/isAbsolute-posix.js n=100000 path='/foo/bar' -0.33 % ±1.39% ±1.85% ±2.42%
path/isAbsolute-posix.js n=100000 path='bar/baz' -1.74 % ±1.98% ±2.66% ±3.51%
path/isAbsolute-win32.js n=100000 path='.' -0.38 % ±1.10% ±1.47% ±1.91%
path/isAbsolute-win32.js n=100000 path='' -0.38 % ±1.39% ±1.85% ±2.40%
path/isAbsolute-win32.js n=100000 path='//server' -0.09 % ±0.83% ±1.10% ±1.43%
path/isAbsolute-win32.js n=100000 path='bar\\\\baz' 0.42 % ±1.31% ±1.75% ±2.29%
path/isAbsolute-win32.js n=100000 path='C:\\\\baz\\\\..' 0.87 % ±1.38% ±1.84% ±2.41%
path/isAbsolute-win32.js n=100000 path='C:baz\\\\..' 0.12 % ±0.70% ±0.93% ±1.22%
path/join-posix.js n=100000 paths='/foo|bar||baz/asdf|quux|..' 0.16 % ±0.88% ±1.17% ±1.53%
path/join-win32.js n=100000 paths='C:\\\\foo|bar||baz\\\\asdf|quux|..' -0.86 % ±0.89% ±1.19% ±1.56%
path/makeLong-win32.js n=100000 path='\\\\\\\\?\\\\foo' -0.09 % ±0.84% ±1.11% ±1.45%
path/makeLong-win32.js n=100000 path='\\\\\\\\foo\\\\bar' -0.74 % ±1.51% ±2.03% ±2.66%
path/makeLong-win32.js n=100000 path='C:\\\\foo' 0.08 % ±1.24% ±1.66% ±2.17%
path/makeLong-win32.js n=100000 path='foo\\\\bar' 0.61 % ±0.71% ±0.95% ±1.24%
path/normalize-posix.js n=100000 path='.' *** 3.54 % ±1.08% ±1.44% ±1.88%
path/normalize-posix.js n=100000 path='' *** -4.41 % ±1.27% ±1.69% ±2.19%
path/normalize-posix.js n=100000 path='/../' *** 3.22 % ±1.35% ±1.81% ±2.38%
path/normalize-posix.js n=100000 path='/foo' -0.31 % ±1.50% ±1.99% ±2.60%
path/normalize-posix.js n=100000 path='/foo/bar' * 2.67 % ±2.58% ±3.43% ±4.46%
path/normalize-posix.js n=100000 path='/foo/bar//baz/asdf/quux/..' 0.28 % ±1.29% ±1.72% ±2.26%
path/normalize-win32.js n=100000 path='.' -0.49 % ±2.45% ±3.26% ±4.25%
path/normalize-win32.js n=100000 path='' * 2.28 % ±2.19% ±2.93% ±3.82%
path/normalize-win32.js n=100000 path='C:\\\\..\\\\' -0.66 % ±1.32% ±1.76% ±2.30%
path/normalize-win32.js n=100000 path='C:\\\\foo' -0.18 % ±2.00% ±2.66% ±3.47%
path/normalize-win32.js n=100000 path='C:\\\\foo\\\\bar' 1.10 % ±1.36% ±1.83% ±2.41%
path/normalize-win32.js n=100000 path='C:\\\\foo\\\\bar\\\\\\\\baz\\\\asdf\\\\quux\\\\..' 0.51 % ±0.88% ±1.18% ±1.53%
path/parse-posix.js n=100000 path='' *** -6.49 % ±2.15% ±2.88% ±3.77%
path/parse-posix.js n=100000 path='/' * 1.60 % ±1.35% ±1.80% ±2.36%
path/parse-posix.js n=100000 path='/foo' *** -3.34 % ±1.22% ±1.64% ±2.15%
path/parse-posix.js n=100000 path='/foo/bar.baz' 1.02 % ±1.54% ±2.05% ±2.68%
path/parse-posix.js n=100000 path='/foo/bar/baz/asdf/.quux' ** 3.21 % ±2.19% ±2.91% ±3.79%
path/parse-posix.js n=100000 path='foo/.bar.baz' * -2.75 % ±2.42% ±3.22% ±4.20%
path/parse-posix.js n=100000 path='foo/bar' *** -2.99 % ±1.02% ±1.36% ±1.77%
path/parse-win32.js n=100000 path='' 0.07 % ±1.83% ±2.43% ±3.17%
path/parse-win32.js n=100000 path='\\\\foo' * 1.36 % ±1.23% ±1.65% ±2.17%
path/parse-win32.js n=100000 path='\\\\foo\\\\bar\\\\baz\\\\asdf\\\\.quux' -0.06 % ±1.54% ±2.04% ±2.66%
path/parse-win32.js n=100000 path='C:\\\\' 1.26 % ±1.60% ±2.14% ±2.82%
path/parse-win32.js n=100000 path='C:\\\\foo' -1.95 % ±2.43% ±3.24% ±4.25%
path/parse-win32.js n=100000 path='E:\\\\foo\\\\bar.baz' 0.11 % ±1.59% ±2.11% ±2.75%
path/parse-win32.js n=100000 path='foo\\\\.bar.baz' * 2.16 % ±2.14% ±2.88% ±3.81%
path/parse-win32.js n=100000 path='foo\\\\bar' -1.81 % ±2.24% ±2.99% ±3.91%
path/relative-posix.js n=100000 paths='/|/' -0.49 % ±1.70% ±2.27% ±2.97%
path/relative-posix.js n=100000 paths='/|/var' 0.03 % ±0.98% ±1.31% ±1.71%
path/relative-posix.js n=100000 paths='/data/orandea/test/aaa|/data/orandea/impl/bbb' -0.01 % ±0.37% ±0.50% ±0.65%
path/relative-posix.js n=100000 paths='/foo/bar/baz/quux|/' *** 1.44 % ±0.46% ±0.62% ±0.80%
path/relative-posix.js n=100000 paths='/foo/bar/baz/quux|/foo/bar/baz/quux' 3.13 % ±4.87% ±6.49% ±8.47%
path/relative-posix.js n=100000 paths='/foo/bar/baz/quux|/var/log' *** 1.10 % ±0.28% ±0.37% ±0.48%
path/relative-posix.js n=100000 paths='/var|/bin' *** 1.85 % ±0.48% ±0.64% ±0.83%
path/relative-win32.js n=100000 paths='C:\\\\|D:\\\\' -0.69 % ±1.59% ±2.11% ±2.76%
path/relative-win32.js n=100000 paths='C:\\\\foo\\\\bar\\\\baz\\\\quux|C:\\\\' -0.44 % ±0.78% ±1.04% ±1.36%
path/relative-win32.js n=100000 paths='C:\\\\foo\\\\bar\\\\baz|C:\\\\foo\\\\bar\\\\baz' 1.37 % ±2.90% ±3.87% ±5.06%
path/relative-win32.js n=100000 paths='C:\\\\foo\\\\BAR\\\\BAZ|C:\\\\foo\\\\bar\\\\baz' ** -0.59 % ±0.39% ±0.52% ±0.68%
path/relative-win32.js n=100000 paths='c:\\\\İ\\\\a\\\\İ|c:\\\\İ\\\\b\\\\İ\\\\test.txt|..\\\\..\\\\b\\\\İ\\\\test.txt' ** 0.70 % ±0.43% ±0.58% ±0.75%
path/relative-win32.js n=100000 paths='C:\\\\orandea\\\\test\\\\aaa|C:\\\\orandea\\\\impl\\\\bbb' * 0.66 % ±0.56% ±0.74% ±0.97%
path/resolve-posix.js n=100000 paths='' * 1.04 % ±1.04% ±1.38% ±1.80%
path/resolve-posix.js n=100000 paths='|' 1.03 % ±1.56% ±2.07% ±2.70%
path/resolve-posix.js n=100000 paths='a/b/c/|../../..' 0.47 % ±0.58% ±0.77% ±1.00%
path/resolve-posix.js n=100000 paths='foo/bar|/tmp/file/|..|a/../subfile' *** 3.85 % ±0.95% ±1.26% ±1.64%
path/resolve-win32.js n=100000 paths='' 0.27 % ±1.18% ±1.57% ±2.04%
path/resolve-win32.js n=100000 paths='|' 1.07 % ±1.38% ±1.84% ±2.40%
path/resolve-win32.js n=100000 paths='c:/blah\\\\blah|d:/games|c:../a' -0.38 % ±0.77% ±1.02% ±1.33%
path/resolve-win32.js n=100000 paths='c:/ignore|d:\\\\a/b\\\\c/d|\\\\e.exe' 0.83 % ±1.46% ±1.95% ±2.56%
path/toNamespacedPath-posix.js n=100000 path='.' -0.84 % ±4.58% ±6.10% ±7.96%
path/toNamespacedPath-posix.js n=100000 path='' 1.31 % ±3.87% ±5.15% ±6.70%
path/toNamespacedPath-posix.js n=100000 path='/home/node/..' -2.75 % ±3.47% ±4.61% ±6.01%
path/toNamespacedPath-posix.js n=100000 path='/tmp/bar' -1.33 % ±3.71% ±4.93% ±6.42%
path/toNamespacedPath-posix.js n=100000 path='/w/bnch-comp/node/benchmark' -0.63 % ±3.48% ±4.63% ±6.03%
path/toNamespacedPath-posix.js n=100000 path='bar/baz' -2.64 % ±3.93% ±5.22% ±6.80%
path/toNamespacedPath-win32.js n=100000 path='' -0.57 % ±4.44% ±5.91% ±7.70%
path/toNamespacedPath-win32.js n=100000 path='\\\\e.exe' -0.51 % ±1.65% ±2.19% ±2.86%
path/toNamespacedPath-win32.js n=100000 path='\\\\w\\\\bnch-comp\\\\node\\\\benchmark' -0.01 % ±1.35% ±1.80% ±2.34%
path/toNamespacedPath-win32.js n=100000 path='c:../a' -0.41 % ±0.90% ±1.20% ±1.57%
path/toNamespacedPath-win32.js n=100000 path='c:/blah\\\\blah' -0.35 % ±1.17% ±1.55% ±2.02%
path/toNamespacedPath-win32.js n=100000 path='c:/ignore' -1.67 % ±1.92% ±2.58% ±3.40%
path/toNamespacedPath-win32.js n=100000 path='d:/games' -0.85 % ±1.80% ±2.39% ±3.13%
path/toNamespacedPath-win32.js n=100000 path='d:\\\\a/b\\\\c/d' -0.01 % ±0.94% ±1.25% ±1.63%
Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 135 comparisons, you can thus
expect the following amount of false-positive results:
6.75 false positives, when considering a 5% risk acceptance (*, **, ***),
1.35 false positives, when considering a 1% risk acceptance (**, ***),
0.14 false positives, when considering a 0.1% risk acceptance (***)

@nodejs-github-bot

nodejs-github-bot commented Nov 8, 2025

Copy link
Copy Markdown
Collaborator

@aduh95aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 8, 2025

@ljharbljharb 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.

not sure why we have the constants if we're not going to use them, but the primordial conversion is good

Remove `StringPrototypeCharCodeAt` from `posix.resolve`,
`posix.normalize`, `posix.parse`
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@gurgundaygurgunday 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.

lgtm

@addaleaxaddaleax added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 2, 2026
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 2, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@aduh95aduh95 added request-ci Add this label to start a Jenkins CI on a PR. labels Apr 27, 2026
@github-actionsgithub-actionsBot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Apr 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor
Failed to start CI
- Validating Jenkins credentials
✔ Jenkins credentials valid
- Querying data for job/node-test-pull-request/71535/
[SyntaxError: Unexpected token '<', ..." https://github.com/nodejs/node/actions/runs/24979596986

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor
Failed to start CI
- Validating Jenkins credentials
✔ Jenkins credentials valid
- Querying data for job/node-test-pull-request/71535/
[SyntaxError: Unexpected token '<', ..." https://github.com/nodejs/node/actions/runs/24979596986

@nodejs-github-bot

nodejs-github-bot commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/72955/
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1841/

Benchmark results
 confidence improvement accuracy (*) (**) (***)
path/basename-posix.js n=100000 pathext='' -5.41 % ±9.01% ±12.14% ±16.09%
path/basename-posix.js n=100000 pathext='/' -0.17 % ±14.39% ±19.15% ±24.92%
path/basename-posix.js n=100000 pathext='/foo' 7.60 % ±14.46% ±19.26% ±25.09%
path/basename-posix.js n=100000 pathext='/foo/.bar.baz' * -10.55 % ±8.51% ±11.40% ±14.99%
path/basename-posix.js n=100000 pathext='/foo/.bar.baz|.baz' -5.78 % ±7.74% ±10.34% ±13.56%
path/basename-posix.js n=100000 pathext='/foo/bar/baz/asdf/quux.html' 1.56 % ±10.35% ±13.77% ±17.93%
path/basename-posix.js n=100000 pathext='/foo/bar/baz/asdf/quux.html|.html' -2.83 % ±8.80% ±11.71% ±15.25%
path/basename-posix.js n=100000 pathext='foo' * -2.22 % ±1.96% ±2.62% ±3.41%
path/basename-posix.js n=100000 pathext='foo/bar.' 1.80 % ±11.77% ±15.66% ±20.40%
path/basename-posix.js n=100000 pathext='foo/bar.|.' 2.23 % ±5.79% ±7.70% ±10.02%
path/dirname-posix.js n=100000 path='' -0.90 % ±2.20% ±2.93% ±3.81%
path/dirname-posix.js n=100000 path='/' 0.36 % ±2.39% ±3.18% ±4.14%
path/dirname-posix.js n=100000 path='/foo' -0.46 % ±2.08% ±2.77% ±3.61%
path/dirname-posix.js n=100000 path='/foo/bar' 1.97 % ±2.82% ±3.75% ±4.89%
path/dirname-posix.js n=100000 path='/foo/bar/baz/asdf/quux' 1.14 % ±4.62% ±6.16% ±8.03%
path/dirname-posix.js n=100000 path='foo' -3.13 % ±6.08% ±8.13% ±10.66%
path/dirname-posix.js n=100000 path='foo/bar' 1.31 % ±3.22% ±4.28% ±5.58%
path/extname-posix.js n=100000 path='' -0.18 % ±1.50% ±2.00% ±2.60%
path/extname-posix.js n=100000 path='/' -5.35 % ±8.88% ±11.95% ±15.83%
path/extname-posix.js n=100000 path='/foo' 2.71 % ±6.76% ±9.08% ±11.98%
path/extname-posix.js n=100000 path='/foo/bar/baz/asdf/quux.foobarbazasdfquux' 3.26 % ±3.49% ±4.64% ±6.03%
path/extname-posix.js n=100000 path='/foo/bar/baz/asdf/quux' 3.67 % ±6.97% ±9.28% ±12.09%
path/extname-posix.js n=100000 path='foo/.bar.baz' 0.66 % ±6.20% ±8.25% ±10.74%
path/extname-posix.js n=100000 path='foo/bar/...baz.quux' -1.35 % ±5.01% ±6.67% ±8.68%
path/extname-posix.js n=100000 path='foo/bar/..baz.quux' 0.34 % ±3.79% ±5.04% ±6.56%
path/extname-posix.js n=100000 path='index.html' -2.45 % ±10.55% ±14.04% ±18.28%
path/extname-posix.js n=100000 path='index' -6.29 % ±7.59% ±10.22% ±13.53%
path/format-posix.js n=1000000 props='/|/home/user/dir|index.html|.html|index' -0.20 % ±2.15% ±2.86% ±3.73%
path/isAbsolute-posix.js n=100000 path='.' -6.97 % ±14.66% ±19.56% ±25.58%
path/isAbsolute-posix.js n=100000 path='' 8.67 % ±18.95% ±25.24% ±32.92%
path/isAbsolute-posix.js n=100000 path='/baz/..' -4.52 % ±12.96% ±17.26% ±22.52%
path/isAbsolute-posix.js n=100000 path='/foo/bar' 4.23 % ±15.55% ±20.70% ±26.98%
path/isAbsolute-posix.js n=100000 path='bar/baz' -13.25 % ±13.71% ±18.45% ±24.45%
path/join-posix.js n=100000 paths='/foo|bar||baz/asdf|quux|..' -0.25 % ±1.72% ±2.30% ±3.01%
path/normalize-posix.js n=100000 path='.' -0.78 % ±2.65% ±3.52% ±4.58%
path/normalize-posix.js n=100000 path='' -5.91 % ±6.61% ±8.80% ±11.47%
path/normalize-posix.js n=100000 path='/../' -0.81 % ±7.10% ±9.50% ±12.47%
path/normalize-posix.js n=100000 path='/foo' 1.00 % ±2.73% ±3.64% ±4.77%
path/normalize-posix.js n=100000 path='/foo/bar' -3.27 % ±5.43% ±7.24% ±9.45%
path/normalize-posix.js n=100000 path='/foo/bar//baz/asdf/quux/..' 2.36 % ±2.48% ±3.30% ±4.31%
path/parse-posix.js n=100000 path='' -3.93 % ±6.13% ±8.22% ±10.84%
path/parse-posix.js n=100000 path='/' 4.95 % ±5.66% ±7.61% ±10.06%
path/parse-posix.js n=100000 path='/foo' 5.38 % ±11.42% ±15.20% ±19.80%
path/parse-posix.js n=100000 path='/foo/bar.baz' 2.56 % ±4.99% ±6.64% ±8.64%
path/parse-posix.js n=100000 path='/foo/bar/baz/asdf/.quux' 4.93 % ±8.32% ±11.09% ±14.45%
path/parse-posix.js n=100000 path='foo/.bar.baz' -0.81 % ±5.59% ±7.45% ±9.72%
path/parse-posix.js n=100000 path='foo/bar' -1.08 % ±12.18% ±16.20% ±21.09%
path/relative-posix.js n=100000 paths='/|/' -1.73 % ±2.37% ±3.15% ±4.10%
path/relative-posix.js n=100000 paths='/|/var' -3.08 % ±5.45% ±7.25% ±9.44%
path/relative-posix.js n=100000 paths='/data/orandea/test/aaa|/data/orandea/impl/bbb' -0.75 % ±1.28% ±1.70% ±2.21%
path/relative-posix.js n=100000 paths='/foo/bar/baz/quux|/' -1.76 % ±2.45% ±3.26% ±4.26%
path/relative-posix.js n=100000 paths='/foo/bar/baz/quux|/foo/bar/baz/quux' 3.20 % ±6.39% ±8.51% ±11.07%
path/relative-posix.js n=100000 paths='/foo/bar/baz/quux|/var/log' -1.13 % ±2.68% ±3.58% ±4.67%
path/relative-posix.js n=100000 paths='/var|/bin' -1.15 % ±2.92% ±3.89% ±5.06%
path/resolve-posix.js n=100000 paths='.' -0.33 % ±5.15% ±6.86% ±8.93%
path/resolve-posix.js n=100000 paths='' 0.30 % ±4.83% ±6.43% ±8.37%
path/resolve-posix.js n=100000 paths='/a/b/c/|abc' -2.02 % ±3.07% ±4.09% ±5.32%
path/resolve-posix.js n=100000 paths='|' -1.51 % ±3.62% ±4.82% ±6.28%
path/resolve-posix.js n=100000 paths='a/b/c/|../../..' -2.51 % ±2.84% ±3.78% ±4.93%
path/resolve-posix.js n=100000 paths='empty' -1.72 % ±5.30% ±7.06% ±9.23%
path/resolve-posix.js n=100000 paths='foo/bar|/tmp/file/|..|a/../subfile' ** -3.27 % ±2.03% ±2.70% ±3.52%
path/toNamespacedPath-posix.js n=100000 path='.' -2.10 % ±4.31% ±5.74% ±7.48%
path/toNamespacedPath-posix.js n=100000 path='' -1.47 % ±5.00% ±6.68% ±8.74%
path/toNamespacedPath-posix.js n=100000 path='/home/node/..' -2.74 % ±3.73% ±4.98% ±6.49%
path/toNamespacedPath-posix.js n=100000 path='/tmp/bar' * -4.93 % ±4.75% ±6.32% ±8.22%
path/toNamespacedPath-posix.js n=100000 path='/w/bnch-comp/node/benchmark' -0.89 % ±4.03% ±5.36% ±6.98%
path/toNamespacedPath-posix.js n=100000 path='bar/baz' -2.73 % ±3.97% ±5.28% ±6.88%
Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 67 comparisons, you can thus
expect the following amount of false-positive results:
3.35 false positives, when considering a 5% risk acceptance (*, **, ***),
0.67 false positives, when considering a 1% risk acceptance (**, ***),
0.07 false positives, when considering a 0.1% risk acceptance (***)

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikr

trivikr commented Jun 22, 2026

Copy link
Copy Markdown
Member

Benchmarks run in #54668 (comment) show a performance decline.

@github-actions

github-actionsBot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Benchmark GHA (path / posix): https://github.com/nodejs/node/actions/runs/31022757214

Results

[!WARNING]
Do not take GHA benchmark results as face value, always confirm them
using a dedicated machine, e.g. Jenkins CI.

Benchmark results:

 confidence improvement accuracy (*) (**) (***)
path/basename-posix.js n=100000 pathext='' -0.50 % ±7.88% ±10.39% ±13.33%
path/basename-posix.js n=100000 pathext='/' 1.79 % ±8.37% ±11.04% ±14.16%
path/basename-posix.js n=100000 pathext='/foo' -3.53 % ±7.40% ±9.75% ±12.51%
path/basename-posix.js n=100000 pathext='/foo/.bar.baz' 1.53 % ±6.48% ±8.55% ±10.97%
path/basename-posix.js n=100000 pathext='/foo/.bar.baz|.baz' 0.42 % ±6.28% ±8.28% ±10.62%
path/basename-posix.js n=100000 pathext='/foo/bar/baz/asdf/quux.html' 2.03 % ±6.79% ±8.95% ±11.48%
path/basename-posix.js n=100000 pathext='/foo/bar/baz/asdf/quux.html|.html' 0.62 % ±6.56% ±8.64% ±11.09%
path/basename-posix.js n=100000 pathext='foo' 0.49 % ±7.71% ±10.16% ±13.04%
path/basename-posix.js n=100000 pathext='foo/bar.' -0.28 % ±7.39% ±9.75% ±12.51%
path/basename-posix.js n=100000 pathext='foo/bar.|.' -1.51 % ±7.11% ±9.37% ±12.02%
path/dirname-posix.js n=100000 path='' -1.12 % ±6.67% ±8.79% ±11.27%
path/dirname-posix.js n=100000 path='/' -2.40 % ±6.72% ±8.86% ±11.36%
path/dirname-posix.js n=100000 path='/foo' 0.67 % ±6.39% ±8.42% ±10.80%
path/dirname-posix.js n=100000 path='/foo/bar' -1.41 % ±6.17% ±8.13% ±10.43%
path/dirname-posix.js n=100000 path='/foo/bar/baz/asdf/quux' -0.09 % ±6.38% ±8.41% ±10.79%
path/dirname-posix.js n=100000 path='foo' 1.21 % ±6.24% ±8.23% ±10.56%
path/dirname-posix.js n=100000 path='foo/bar' * -5.65 % ±5.48% ±7.22% ±9.27%
path/extname-posix.js n=100000 path='' 1.99 % ±7.35% ±9.69% ±12.43%
path/extname-posix.js n=100000 path='/' 2.68 % ±7.29% ±9.61% ±12.33%
path/extname-posix.js n=100000 path='/foo' 0.39 % ±7.01% ±9.24% ±11.86%
path/extname-posix.js n=100000 path='/foo/bar/baz/asdf/quux.foobarbazasdfquux' 0.17 % ±5.28% ±6.97% ±8.94%
path/extname-posix.js n=100000 path='/foo/bar/baz/asdf/quux' -3.08 % ±6.24% ±8.23% ±10.56%
path/extname-posix.js n=100000 path='foo/.bar.baz' 3.41 % ±6.31% ±8.32% ±10.68%
path/extname-posix.js n=100000 path='foo/bar/...baz.quux' 0.40 % ±6.57% ±8.66% ±11.12%
path/extname-posix.js n=100000 path='foo/bar/..baz.quux' 0.87 % ±6.26% ±8.25% ±10.58%
path/extname-posix.js n=100000 path='index.html' 1.73 % ±5.08% ±6.69% ±8.59%
path/extname-posix.js n=100000 path='index' 2.31 % ±6.95% ±9.16% ±11.76%
path/format-posix.js n=1000000 props='/|/home/user/dir|index.html|.html|index' 0.71 % ±5.66% ±7.46% ±9.58%
path/isAbsolute-posix.js n=100000 path='.' -1.63 % ±8.65% ±11.40% ±14.63%
path/isAbsolute-posix.js n=100000 path='' -3.81 % ±8.64% ±11.38% ±14.61%
path/isAbsolute-posix.js n=100000 path='/baz/..' -0.69 % ±8.69% ±11.46% ±14.70%
path/isAbsolute-posix.js n=100000 path='/foo/bar' -0.79 % ±8.65% ±11.40% ±14.63%
path/isAbsolute-posix.js n=100000 path='bar/baz' -1.92 % ±8.24% ±10.87% ±13.94%
path/join-posix.js n=100000 paths='/foo|bar||baz/asdf|quux|..' -0.36 % ±7.99% ±10.53% ±13.51%
path/matchesGlob-posix.js n=100000 pattern='src/**/baz/*.test.ts' path='src/foo/bar/biz/baz/index.test.ts' -0.18 % ±7.54% ±9.94% ±12.76%
path/matchesGlob-posix.js n=100000 pattern='src/**/baz/*.test.ts' path='src/index.test.ts' -0.47 % ±8.16% ±10.76% ±13.81%
path/matchesGlob-posix.js n=100000 pattern='src/**/baz/*.test.ts' path='src/index.ts' -0.35 % ±7.80% ±10.28% ±13.19%
path/matchesGlob-posix.js n=100000 pattern='src/**/baz/*.ts' path='src/foo/bar/biz/baz/index.test.ts' -1.25 % ±7.42% ±9.78% ±12.54%
path/matchesGlob-posix.js n=100000 pattern='src/**/baz/*.ts' path='src/index.test.ts' -0.46 % ±8.04% ±10.60% ±13.60%
path/matchesGlob-posix.js n=100000 pattern='src/**/baz/*.ts' path='src/index.ts' -1.18 % ±8.22% ±10.83% ±13.89%
path/matchesGlob-posix.js n=100000 pattern='test/**/*.ts' path='src/foo/bar/biz/baz/index.test.ts' -0.53 % ±7.35% ±9.68% ±12.43%
path/matchesGlob-posix.js n=100000 pattern='test/**/*.ts' path='src/index.test.ts' -1.53 % ±8.03% ±10.58% ±13.58%
path/matchesGlob-posix.js n=100000 pattern='test/**/*.ts' path='src/index.ts' 0.47 % ±8.14% ±10.73% ±13.76%
path/normalize-posix.js n=100000 path='.' 3.41 % ±8.29% ±10.93% ±14.03%
path/normalize-posix.js n=100000 path='' 3.98 % ±8.23% ±10.85% ±13.92%
path/normalize-posix.js n=100000 path='/../' 0.74 % ±7.41% ±9.77% ±12.54%
path/normalize-posix.js n=100000 path='/foo' 0.11 % ±7.40% ±9.75% ±12.51%
path/normalize-posix.js n=100000 path='/foo/bar' -0.59 % ±7.42% ±9.78% ±12.55%
path/normalize-posix.js n=100000 path='/foo/bar//baz/asdf/quux/..' 0.83 % ±7.06% ±9.31% ±11.94%
path/parse-posix.js n=100000 path='' -0.47 % ±8.23% ±10.85% ±13.92%
path/parse-posix.js n=100000 path='/' -3.41 % ±7.89% ±10.40% ±13.34%
path/parse-posix.js n=100000 path='/foo' 2.57 % ±7.48% ±9.86% ±12.65%
path/parse-posix.js n=100000 path='/foo/bar.baz' 0.72 % ±7.39% ±9.73% ±12.49%
path/parse-posix.js n=100000 path='/foo/bar/baz/asdf/.quux' -0.63 % ±8.59% ±11.32% ±14.52%
path/parse-posix.js n=100000 path='foo/.bar.baz' 0.88 % ±7.81% ±10.30% ±13.22%
path/parse-posix.js n=100000 path='foo/bar' -0.60 % ±7.81% ±10.29% ±13.21%
path/relative-posix.js n=100000 paths='/|/' 0.66 % ±8.43% ±11.11% ±14.26%
path/relative-posix.js n=100000 paths='/|/var' -1.66 % ±7.03% ±9.26% ±11.89%
path/relative-posix.js n=100000 paths='/data/orandea/test/aaa|/data/orandea/impl/bbb' 1.04 % ±7.88% ±10.38% ±13.32%
path/relative-posix.js n=100000 paths='/foo/bar/baz/quux|/' -0.33 % ±7.17% ±9.45% ±12.12%
path/relative-posix.js n=100000 paths='/foo/bar/baz/quux|/foo/bar/baz/quux' 2.95 % ±9.10% ±12.00% ±15.40%
path/relative-posix.js n=100000 paths='/foo/bar/baz/quux|/var/log' 0.25 % ±7.52% ±9.92% ±12.73%
path/relative-posix.js n=100000 paths='/var|/bin' -1.58 % ±7.02% ±9.26% ±11.88%
path/resolve-posix.js n=100000 paths='.' 2.31 % ±8.40% ±11.07% ±14.21%
path/resolve-posix.js n=100000 paths='' 4.91 % ±9.65% ±12.72% ±16.32%
path/resolve-posix.js n=100000 paths='/a/b/c/|abc' 1.52 % ±7.87% ±10.38% ±13.32%
path/resolve-posix.js n=100000 paths='|' 1.91 % ±7.84% ±10.34% ±13.26%
path/resolve-posix.js n=100000 paths='a/b/c/|../../..' -0.32 % ±7.85% ±10.34% ±13.27%
path/resolve-posix.js n=100000 paths='empty' 0.46 % ±9.91% ±13.06% ±16.75%
path/resolve-posix.js n=100000 paths='foo/bar|/tmp/file/|..|a/../subfile' -1.44 % ±7.70% ±10.15% ±13.03%
path/toNamespacedPath-posix.js n=100000 path='.' 3.41 % ±8.53% ±11.24% ±14.42%
path/toNamespacedPath-posix.js n=100000 path='' -0.97 % ±8.44% ±11.13% ±14.28%
path/toNamespacedPath-posix.js n=100000 path='/home/node/..' 2.29 % ±8.58% ±11.30% ±14.51%
path/toNamespacedPath-posix.js n=100000 path='/home/runner/work/node/node/benchmark' 1.30 % ±4.01% ±5.31% ±6.84%
path/toNamespacedPath-posix.js n=100000 path='/tmp/bar' 1.87 % ±8.54% ±11.26% ±14.45%
path/toNamespacedPath-posix.js n=100000 path='/Users/runner/work/node/node/benchmark' 8.67 % ±15.91% ±21.03% ±27.11%
path/toNamespacedPath-posix.js n=100000 path='bar/baz' 1.00 % ±8.19% ±10.80% ±13.86%
Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 77 comparisons, you can thus
expect the following amount of false-positive results:
3.85 false positives, when considering a 5% risk acceptance (*, **, ***),
0.77 false positives, when considering a 1% risk acceptance (**, ***),
0.08 false positives, when considering a 0.1% risk acceptance (***)

[!WARNING]
Do not take GHA benchmark results as face value, always confirm them
using a dedicated machine, e.g. Jenkins CI.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.needs-benchmark-ciPR that need a benchmark CI run.needs-ciPRs that need a full CI run.pathIssues and PRs related to the path subsystem.request-ci-failedAn error occurred while starting CI via request-ci label, and manual interventon is needed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@HBSPS@nodejs-github-bot@trivikr@ljharb@lpinca@avivkeller@gurgunday@addaleax@aduh95