-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
path: support file urls #52672
path: support file urls #52672
Conversation
Review requested:
|
Failed to start CI⚠ No approving reviews found ✘ Refusing to run CI on potentially unsafe PRhttps://github.com/nodejs/node/actions/runs/8823064389 |
That's a good sign (for security) [i think] Do CIs now need approving reviews? 🎉 |
They don't strictly need it. Collaborators can still start CI jobs from Jenkins. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with or without the following nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see a benchmark result before merging a PR like this that effects every single function in Node.js
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1534/ Results
|
This comment was marked as duplicate.
This comment was marked as duplicate.
2082c31
to
b1058ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark CI results
confidence improvement accuracy (*) (**) (***)
path/basename-posix.js n=100000 pathext='' -0.55 % ±1.29% ±1.71% ±2.20%
path/basename-posix.js n=100000 pathext='/' *** -1.38 % ±0.78% ±1.03% ±1.32%
path/basename-posix.js n=100000 pathext='/foo' * -1.16 % ±1.07% ±1.41% ±1.82%
path/basename-posix.js n=100000 pathext='/foo/.bar.baz' 0.19 % ±1.27% ±1.68% ±2.16%
path/basename-posix.js n=100000 pathext='/foo/.bar.baz|.baz' -0.87 % ±1.35% ±1.79% ±2.30%
path/basename-posix.js n=100000 pathext='/foo/bar/baz/asdf/quux.html' -0.10 % ±1.34% ±1.77% ±2.28%
path/basename-posix.js n=100000 pathext='/foo/bar/baz/asdf/quux.html|.html' ** -2.45 % ±1.68% ±2.22% ±2.85%
path/basename-posix.js n=100000 pathext='foo' *** -1.88 % ±0.75% ±0.99% ±1.27%
path/basename-posix.js n=100000 pathext='foo/bar.' -0.59 % ±0.81% ±1.07% ±1.38%
path/basename-posix.js n=100000 pathext='foo/bar.|.' ** -0.98 % ±0.72% ±0.94% ±1.22%
path/basename-win32.js n=100000 pathext='' ** -1.11 % ±0.82% ±1.08% ±1.39%
path/basename-win32.js n=100000 pathext='\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux.html' -0.05 % ±0.93% ±1.23% ±1.58%
path/basename-win32.js n=100000 pathext='\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux.html|.html' -0.75 % ±1.16% ±1.52% ±1.96%
path/basename-win32.js n=100000 pathext='C:\\\\' -0.10 % ±0.81% ±1.06% ±1.37%
path/basename-win32.js n=100000 pathext='C:\\\\foo' *** -2.59 % ±1.06% ±1.40% ±1.80%
path/basename-win32.js n=100000 pathext='D:\\\\foo\\\\.bar.baz' * -1.10 % ±0.85% ±1.12% ±1.44%
path/basename-win32.js n=100000 pathext='E:\\\\foo\\\\.bar.baz|.baz' ** -1.50 % ±0.90% ±1.19% ±1.53%
path/basename-win32.js n=100000 pathext='foo' *** -0.62 % ±0.35% ±0.46% ±0.59%
path/basename-win32.js n=100000 pathext='foo\\\\bar.' * -0.86 % ±0.75% ±0.99% ±1.28%
path/basename-win32.js n=100000 pathext='foo\\\\bar.|.' ** -1.45 % ±1.02% ±1.35% ±1.73%
path/dirname-posix.js n=100000 path='' ** -1.35 % ±0.80% ±1.06% ±1.36%
path/dirname-posix.js n=100000 path='/' *** -1.48 % ±0.73% ±0.97% ±1.24%
path/dirname-posix.js n=100000 path='/foo' *** -1.54 % ±0.56% ±0.73% ±0.94%
path/dirname-posix.js n=100000 path='/foo/bar' *** -1.23 % ±0.66% ±0.87% ±1.12%
path/dirname-posix.js n=100000 path='/foo/bar/baz/asdf/quux' * -1.59 % ±1.29% ±1.70% ±2.18%
path/dirname-posix.js n=100000 path='foo' *** -1.81 % ±0.52% ±0.69% ±0.89%
path/dirname-posix.js n=100000 path='foo/bar' *** -1.43 % ±0.35% ±0.46% ±0.60%
path/dirname-win32.js n=100000 path='' *** -4.07 % ±1.21% ±1.59% ±2.04%
path/dirname-win32.js n=100000 path='\\\\' *** -1.45 % ±0.81% ±1.07% ±1.38%
path/dirname-win32.js n=100000 path='\\\\foo' ** -1.22 % ±0.86% ±1.13% ±1.45%
path/dirname-win32.js n=100000 path='C:\\\\foo\\\\bar' -0.82 % ±0.90% ±1.18% ±1.52%
path/dirname-win32.js n=100000 path='D:\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux' -0.65 % ±1.09% ±1.44% ±1.85%
path/dirname-win32.js n=100000 path='foo' *** -1.90 % ±1.05% ±1.39% ±1.78%
path/dirname-win32.js n=100000 path='foo\\\\bar' -0.42 % ±0.59% ±0.78% ±1.01%
path/extname-posix.js n=100000 path='' *** -4.55 % ±2.46% ±3.25% ±4.18%
path/extname-posix.js n=100000 path='/' *** -2.05 % ±1.05% ±1.38% ±1.78%
path/extname-posix.js n=100000 path='/foo' *** -4.64 % ±0.87% ±1.15% ±1.48%
path/extname-posix.js n=100000 path='/foo/bar/baz/asdf/quux.foobarbazasdfquux' -1.14 % ±1.64% ±2.16% ±2.77%
path/extname-posix.js n=100000 path='/foo/bar/baz/asdf/quux' 0.24 % ±1.28% ±1.69% ±2.17%
path/extname-posix.js n=100000 path='foo/.bar.baz' 0.77 % ±1.10% ±1.45% ±1.86%
path/extname-posix.js n=100000 path='foo/bar/...baz.quux' -1.58 % ±1.62% ±2.14% ±2.75%
path/extname-posix.js n=100000 path='foo/bar/..baz.quux' * -1.75 % ±1.72% ±2.27% ±2.92%
path/extname-posix.js n=100000 path='index.html' -0.62 % ±1.28% ±1.68% ±2.16%
path/extname-posix.js n=100000 path='index' 0.13 % ±1.16% ±1.53% ±1.96%
path/extname-win32.js n=100000 path='' *** -1.99 % ±1.03% ±1.36% ±1.75%
path/extname-win32.js n=100000 path='\\\\' *** -3.51 % ±1.45% ±1.91% ±2.46%
path/extname-win32.js n=100000 path='\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux.foobarbazasdfquux' -0.54 % ±1.47% ±1.94% ±2.49%
path/extname-win32.js n=100000 path='C:\\\\foo' * -0.99 % ±0.83% ±1.10% ±1.41%
path/extname-win32.js n=100000 path='D:\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux' 0.36 % ±1.02% ±1.34% ±1.72%
path/extname-win32.js n=100000 path='foo\\\\.bar.baz' 0.18 % ±1.17% ±1.54% ±1.98%
path/extname-win32.js n=100000 path='foo\\\\bar\\\\...baz.quux' 0.18 % ±1.07% ±1.41% ±1.82%
path/extname-win32.js n=100000 path='foo\\\\bar\\\\..baz.quux' * -1.29 % ±1.16% ±1.53% ±1.96%
path/extname-win32.js n=100000 path='index.html' * -1.05 % ±0.84% ±1.11% ±1.42%
path/extname-win32.js n=100000 path='index' *** -2.03 % ±1.05% ±1.38% ±1.77%
path/format-posix.js n=1000000 props='/|/home/user/dir|index.html|.html|index' 0.18 % ±0.46% ±0.61% ±0.78%
path/format-win32.js n=1000000 props='C:\\\\|C:\\\\path\\\\dir|index.html|.html|index' 0.15 % ±0.39% ±0.51% ±0.65%
path/isAbsolute-posix.js n=100000 path='.' *** -2.05 % ±0.85% ±1.12% ±1.44%
path/isAbsolute-posix.js n=100000 path='' *** -3.72 % ±1.05% ±1.38% ±1.78%
path/isAbsolute-posix.js n=100000 path='/baz/..' *** -1.40 % ±0.69% ±0.91% ±1.17%
path/isAbsolute-posix.js n=100000 path='/foo/bar' *** -2.54 % ±0.82% ±1.08% ±1.39%
path/isAbsolute-posix.js n=100000 path='bar/baz' *** -2.25 % ±0.71% ±0.93% ±1.20%
path/isAbsolute-win32.js n=100000 path='.' *** -1.45 % ±0.64% ±0.84% ±1.08%
path/isAbsolute-win32.js n=100000 path='' -1.14 % ±1.15% ±1.52% ±1.95%
path/isAbsolute-win32.js n=100000 path='//server' *** -6.37 % ±1.03% ±1.36% ±1.75%
path/isAbsolute-win32.js n=100000 path='bar\\\\baz' *** -1.83 % ±0.46% ±0.61% ±0.78%
path/isAbsolute-win32.js n=100000 path='C:\\\\baz\\\\..' * -0.54 % ±0.43% ±0.57% ±0.73%
path/isAbsolute-win32.js n=100000 path='C:baz\\\\..' *** -0.90 % ±0.44% ±0.58% ±0.75%
path/join-posix.js n=100000 paths='/foo|bar||baz/asdf|quux|..' 0.29 % ±0.56% ±0.74% ±0.95%
path/join-win32.js n=100000 paths='C:\\\\foo|bar||baz\\\\asdf|quux|..' *** -1.12 % ±0.48% ±0.64% ±0.82%
path/makeLong-win32.js n=100000 path='\\\\\\\\?\\\\foo' -0.40 % ±0.54% ±0.72% ±0.92%
path/makeLong-win32.js n=100000 path='\\\\\\\\foo\\\\bar' -0.49 % ±0.77% ±1.01% ±1.30%
path/makeLong-win32.js n=100000 path='C:\\\\foo' -0.49 % ±1.46% ±1.93% ±2.48%
path/makeLong-win32.js n=100000 path='foo\\\\bar' -0.30 % ±0.42% ±0.55% ±0.70%
path/normalize-posix.js n=100000 path='.' *** -1.70 % ±0.61% ±0.81% ±1.04%
path/normalize-posix.js n=100000 path='' *** -1.73 % ±0.92% ±1.22% ±1.57%
path/normalize-posix.js n=100000 path='/../' *** -1.27 % ±0.45% ±0.60% ±0.77%
path/normalize-posix.js n=100000 path='/foo' ** -1.62 % ±1.03% ±1.36% ±1.75%
path/normalize-posix.js n=100000 path='/foo/bar' *** -2.05 % ±0.83% ±1.10% ±1.42%
path/normalize-posix.js n=100000 path='/foo/bar//baz/asdf/quux/..' *** 1.49 % ±0.67% ±0.88% ±1.13%
path/normalize-win32.js n=100000 path='.' -0.28 % ±1.13% ±1.49% ±1.91%
path/normalize-win32.js n=100000 path='' * -1.65 % ±1.29% ±1.71% ±2.19%
path/normalize-win32.js n=100000 path='C:\\\\..\\\\' * -1.15 % ±0.99% ±1.31% ±1.68%
path/normalize-win32.js n=100000 path='C:\\\\foo' *** -1.48 % ±0.87% ±1.15% ±1.48%
path/normalize-win32.js n=100000 path='C:\\\\foo\\\\bar' *** -1.85 % ±0.77% ±1.02% ±1.31%
path/normalize-win32.js n=100000 path='C:\\\\foo\\\\bar\\\\\\\\baz\\\\asdf\\\\quux\\\\..' 0.02 % ±0.54% ±0.72% ±0.92%
path/parse-posix.js n=100000 path='' *** -3.53 % ±1.20% ±1.59% ±2.04%
path/parse-posix.js n=100000 path='/' *** -1.68 % ±0.70% ±0.92% ±1.18%
path/parse-posix.js n=100000 path='/foo' * -0.73 % ±0.57% ±0.75% ±0.97%
path/parse-posix.js n=100000 path='/foo/bar.baz' -0.59 % ±1.24% ±1.63% ±2.10%
path/parse-posix.js n=100000 path='/foo/bar/baz/asdf/.quux' 1.10 % ±1.57% ±2.07% ±2.66%
path/parse-posix.js n=100000 path='foo/.bar.baz' * -1.90 % ±1.66% ±2.19% ±2.82%
path/parse-posix.js n=100000 path='foo/bar' -0.86 % ±0.91% ±1.20% ±1.55%
path/parse-win32.js n=100000 path='' 0.16 % ±1.16% ±1.53% ±1.97%
path/parse-win32.js n=100000 path='\\\\foo' *** -1.56 % ±0.84% ±1.11% ±1.42%
path/parse-win32.js n=100000 path='\\\\foo\\\\bar\\\\baz\\\\asdf\\\\.quux' * -1.82 % ±1.66% ±2.19% ±2.81%
path/parse-win32.js n=100000 path='C:\\\\' *** -2.60 % ±1.05% ±1.39% ±1.79%
path/parse-win32.js n=100000 path='C:\\\\foo' * -1.17 % ±1.08% ±1.43% ±1.84%
path/parse-win32.js n=100000 path='E:\\\\foo\\\\bar.baz' -0.56 % ±1.13% ±1.49% ±1.92%
path/parse-win32.js n=100000 path='foo\\\\.bar.baz' 0.27 % ±1.07% ±1.42% ±1.82%
path/parse-win32.js n=100000 path='foo\\\\bar' * -1.44 % ±1.24% ±1.64% ±2.11%
path/relative-posix.js n=100000 paths='/|/' *** -2.31 % ±1.21% ±1.59% ±2.05%
path/relative-posix.js n=100000 paths='/|/var' *** -4.80 % ±1.05% ±1.39% ±1.79%
path/relative-posix.js n=100000 paths='/data/orandea/test/aaa|/data/orandea/impl/bbb' *** -1.63 % ±0.32% ±0.43% ±0.55%
path/relative-posix.js n=100000 paths='/foo/bar/baz/quux|/' *** -1.50 % ±0.25% ±0.34% ±0.43%
path/relative-posix.js n=100000 paths='/foo/bar/baz/quux|/foo/bar/baz/quux' -0.42 % ±2.42% ±3.19% ±4.10%
path/relative-posix.js n=100000 paths='/foo/bar/baz/quux|/var/log' *** -1.23 % ±0.24% ±0.32% ±0.41%
path/relative-posix.js n=100000 paths='/var|/bin' *** -0.92 % ±0.50% ±0.66% ±0.85%
path/relative-win32.js n=100000 paths='C:\\\\|D:\\\\' 0.29 % ±0.87% ±1.15% ±1.48%
path/relative-win32.js n=100000 paths='C:\\\\foo\\\\bar\\\\baz\\\\quux|C:\\\\' 0.33 % ±0.56% ±0.73% ±0.94%
path/relative-win32.js n=100000 paths='C:\\\\foo\\\\bar\\\\baz|C:\\\\foo\\\\bar\\\\baz' 2.56 % ±2.64% ±3.48% ±4.47%
path/relative-win32.js n=100000 paths='C:\\\\foo\\\\BAR\\\\BAZ|C:\\\\foo\\\\bar\\\\baz' *** 1.07 % ±0.36% ±0.48% ±0.62%
path/relative-win32.js n=100000 paths='C:\\\\orandea\\\\test\\\\aaa|C:\\\\orandea\\\\impl\\\\bbb' -0.03 % ±0.27% ±0.36% ±0.46%
path/resolve-posix.js n=100000 paths='' 0.24 % ±0.58% ±0.77% ±0.99%
path/resolve-posix.js n=100000 paths='|' 0.08 % ±0.82% ±1.08% ±1.39%
path/resolve-posix.js n=100000 paths='a/b/c/|../../..' -0.03 % ±0.43% ±0.56% ±0.72%
path/resolve-posix.js n=100000 paths='foo/bar|/tmp/file/|..|a/../subfile' 0.43 % ±0.50% ±0.65% ±0.84%
path/resolve-win32.js n=100000 paths='' 0.56 % ±0.60% ±0.79% ±1.01%
path/resolve-win32.js n=100000 paths='|' -0.11 % ±0.76% ±1.01% ±1.30%
path/resolve-win32.js n=100000 paths='c:/blah\\\\blah|d:/games|c:../a' 0.00 % ±0.49% ±0.65% ±0.84%
path/resolve-win32.js n=100000 paths='c:/ignore|d:\\\\a/b\\\\c/d|\\\\e.exe' -0.27 % ±0.86% ±1.13% ±1.45%
path/toNamespacedPath-posix.js n=100000 path='.' *** -20.23 % ±0.97% ±1.28% ±1.65%
path/toNamespacedPath-posix.js n=100000 path='' *** -21.27 % ±1.36% ±1.79% ±2.30%
path/toNamespacedPath-posix.js n=100000 path='/home/node/..' *** -19.78 % ±0.80% ±1.06% ±1.36%
path/toNamespacedPath-posix.js n=100000 path='/tmp/bar' *** -19.69 % ±0.91% ±1.20% ±1.54%
path/toNamespacedPath-posix.js n=100000 path='/w/bnch-comp/node/benchmark' *** -19.40 % ±0.89% ±1.17% ±1.51%
path/toNamespacedPath-posix.js n=100000 path='bar/baz' *** -20.50 % ±1.00% ±1.32% ±1.70%
path/toNamespacedPath-win32.js n=100000 path='' *** -5.66 % ±1.83% ±2.41% ±3.10%
path/toNamespacedPath-win32.js n=100000 path='\\\\e.exe' 0.48 % ±1.46% ±1.93% ±2.48%
path/toNamespacedPath-win32.js n=100000 path='\\\\w\\\\bnch-comp\\\\node\\\\benchmark' 0.20 % ±0.70% ±0.92% ±1.19%
path/toNamespacedPath-win32.js n=100000 path='c:../a' * -0.38 % ±0.36% ±0.48% ±0.61%
path/toNamespacedPath-win32.js n=100000 path='c:/blah\\\\blah' ** -1.70 % ±1.17% ±1.54% ±1.98%
path/toNamespacedPath-win32.js n=100000 path='c:/ignore' -0.33 % ±1.46% ±1.93% ±2.48%
path/toNamespacedPath-win32.js n=100000 path='d:/games' * 1.40 % ±1.23% ±1.63% ±2.09%
path/toNamespacedPath-win32.js n=100000 path='d:\\\\a/b\\\\c/d' -0.78 % ±0.84% ±1.10% ±1.42%
Looks good overall, the only benchmark with significant performance impact is path/toNamespacedPath-posix.js
.
IMHO it's good enough to land as is.
For context, originally path.posix.toNamespacedPath()
is a noop. I doubt that this function is popular in userspace, but it's heavily used in Node.js internals (mostly in pair with getValidatedPath()
, and in internal/modules
).
There is an opened PR moving most of it to c++ (#52135) that should disconnect fs
from performance impacts for js version of toNamespacedPath()
.
Alternatively on js side, I think we can reduce performance penalty in internals by introducing two versions of toNamespacedPath()
: internal API without URL support and as public API with it.
@anonrig WDYT?
While the performance impact seems significant, I don't think it'll be noticeable (but I haven't tested it yet for the actual MS timings). It's just an extra As @LiviaMedeiros said, I could also make an internal function for it to be used in the internals. |
Can we run the benchmarks of file system operations? I don't think 20% is a cost that is acceptable. |
Results confidence improvement accuracy (*) (**) (***)
fs/bench_fdatasyncSync.js n=10000 type='existing' -1.23 % ±3.32% ±4.47% ±5.91%
fs/bench_fdatasyncSync.js n=10000 type='non-existing' 1.53 % ±3.01% ±4.01% ±5.21%
fs/bench-accessSync.js n=100000 type='existing' ** -0.55 % ±0.37% ±0.50% ±0.65%
fs/bench-accessSync.js n=100000 type='non-existing' ** -0.59 % ±0.39% ±0.51% ±0.67%
fs/bench-accessSync.js n=100000 type='non-flat-existing' *** -1.19 % ±0.54% ±0.72% ±0.94%
fs/bench-chmodSync.js n=1000 type='existing' -0.77 % ±1.32% ±1.75% ±2.27%
fs/bench-chmodSync.js n=1000 type='non-existing' -0.65 % ±3.54% ±4.71% ±6.13%
fs/bench-chownSync.js n=10000 method='chownSync' type='existing' -0.83 % ±3.07% ±4.09% ±5.32%
fs/bench-chownSync.js n=10000 method='chownSync' type='non-existing' -0.46 % ±1.19% ±1.58% ±2.05%
fs/bench-chownSync.js n=10000 method='lchownSync' type='existing' -1.61 % ±3.33% ±4.43% ±5.76%
fs/bench-chownSync.js n=10000 method='lchownSync' type='non-existing' 0.17 % ±1.90% ±2.52% ±3.28%
fs/bench-copyFileSync.js n=10000 type='invalid' -0.21 % ±1.47% ±1.95% ±2.54%
fs/bench-copyFileSync.js n=10000 type='valid' -0.12 % ±2.17% ±2.89% ±3.77%
fs/bench-existsSync.js n=1000000 type='existing' 0.01 % ±0.62% ±0.82% ±1.07%
fs/bench-existsSync.js n=1000000 type='non-existing' -0.46 % ±0.58% ±0.77% ±1.00%
fs/bench-existsSync.js n=1000000 type='non-flat-existing' -0.34 % ±0.53% ±0.71% ±0.92%
fs/bench-fchmodSync.js n=1000 type='existing' -4.09 % ±10.26% ±13.77% ±18.16%
fs/bench-fchmodSync.js n=1000 type='non-existing' -0.21 % ±4.23% ±5.63% ±7.32%
fs/bench-fsyncSync.js n=10000 type='existing' -0.22 % ±0.25% ±0.33% ±0.43%
fs/bench-fsyncSync.js n=10000 type='non-existing' -1.67 % ±3.15% ±4.18% ±5.44%
fs/bench-ftruncateSync.js n=10000 type='invalid' -0.37 % ±1.65% ±2.19% ±2.85%
fs/bench-ftruncateSync.js n=10000 type='valid' 1.48 % ±3.99% ±5.30% ±6.89%
fs/bench-linkSync.js n=1000 type='invalid' 1.10 % ±4.59% ±6.10% ±7.94%
fs/bench-linkSync.js n=1000 type='valid' * 4.18 % ±3.58% ±4.76% ±6.20%
fs/bench-mkdirp.js n=10000 * -22.03 % ±18.58% ±24.70% ±32.12%
fs/bench-mkdirSync.js n=1000 recursive='false' type='existing' 1.05 % ±3.25% ±4.33% ±5.64%
fs/bench-mkdirSync.js n=1000 recursive='false' type='non-existing' -5.59 % ±12.80% ±17.01% ±22.12%
fs/bench-mkdirSync.js n=1000 recursive='true' type='existing' 1.87 % ±3.08% ±4.10% ±5.34%
fs/bench-mkdirSync.js n=1000 recursive='true' type='non-existing' 1.90 % ±11.93% ±15.87% ±20.62%
fs/bench-mkdtempSync.js n=10000 type='invalid' -1.67 % ±1.81% ±2.42% ±3.17%
fs/bench-mkdtempSync.js n=10000 type='valid-buffer' -2.31 % ±9.48% ±12.60% ±16.38%
fs/bench-mkdtempSync.js n=10000 type='valid-string' 2.64 % ±9.75% ±12.96% ±16.85%
fs/bench-opendir.js bufferSize=1024 mode='async' dir='lib' n=100 -3.89 % ±4.22% ±5.62% ±7.33%
fs/bench-opendir.js bufferSize=1024 mode='async' dir='test/parallel' n=100 -0.20 % ±0.63% ±0.84% ±1.10%
fs/bench-opendir.js bufferSize=1024 mode='callback' dir='lib' n=100 -0.20 % ±2.08% ±2.76% ±3.59%
fs/bench-opendir.js bufferSize=1024 mode='callback' dir='test/parallel' n=100 -2.80 % ±14.35% ±19.08% ±24.80%
fs/bench-opendir.js bufferSize=1024 mode='sync' dir='lib' n=100 -1.28 % ±1.56% ±2.07% ±2.70%
fs/bench-opendir.js bufferSize=1024 mode='sync' dir='test/parallel' n=100 -0.04 % ±0.64% ±0.85% ±1.11%
fs/bench-opendir.js bufferSize=32 mode='async' dir='lib' n=100 -1.60 % ±3.19% ±4.24% ±5.53%
fs/bench-opendir.js bufferSize=32 mode='async' dir='test/parallel' n=100 0.18 % ±0.64% ±0.85% ±1.10%
fs/bench-opendir.js bufferSize=32 mode='callback' dir='lib' n=100 -0.37 % ±1.77% ±2.35% ±3.06%
fs/bench-opendir.js bufferSize=32 mode='callback' dir='test/parallel' n=100 1.98 % ±2.52% ±3.35% ±4.36%
fs/bench-opendir.js bufferSize=32 mode='sync' dir='lib' n=100 -0.29 % ±1.13% ±1.50% ±1.95%
fs/bench-opendir.js bufferSize=32 mode='sync' dir='test/parallel' n=100 ** -0.64 % ±0.43% ±0.57% ±0.75%
fs/bench-opendir.js bufferSize=4 mode='async' dir='lib' n=100 0.11 % ±1.61% ±2.14% ±2.79%
fs/bench-opendir.js bufferSize=4 mode='async' dir='test/parallel' n=100 -0.09 % ±0.64% ±0.85% ±1.10%
fs/bench-opendir.js bufferSize=4 mode='callback' dir='lib' n=100 -0.80 % ±1.39% ±1.85% ±2.41%
fs/bench-opendir.js bufferSize=4 mode='callback' dir='test/parallel' n=100 -0.71 % ±0.80% ±1.06% ±1.38%
fs/bench-opendir.js bufferSize=4 mode='sync' dir='lib' n=100 -1.55 % ±1.61% ±2.15% ±2.79%
fs/bench-opendir.js bufferSize=4 mode='sync' dir='test/parallel' n=100 *** -1.67 % ±0.34% ±0.46% ±0.60%
fs/bench-opendirSync.js n=1000 type='existing' -0.04 % ±0.42% ±0.57% ±0.74%
fs/bench-opendirSync.js n=1000 type='non-existing' 0.75 % ±4.46% ±5.93% ±7.71%
fs/bench-openSync.js n=100000 type='existing' * 0.76 % ±0.68% ±0.91% ±1.18%
fs/bench-openSync.js n=100000 type='non-existing' -0.06 % ±0.43% ±0.57% ±0.74%
fs/bench-readdir.js withFileTypes='false' dir='lib' n=10 3.13 % ±10.01% ±13.30% ±17.29%
fs/bench-readdir.js withFileTypes='false' dir='test/parallel' n=10 2.55 % ±8.29% ±11.03% ±14.34%
fs/bench-readdir.js withFileTypes='true' dir='lib' n=10 1.98 % ±11.27% ±15.01% ±19.57%
fs/bench-readdir.js withFileTypes='true' dir='test/parallel' n=10 0.25 % ±6.94% ±9.24% ±12.03%
fs/bench-readdirSync.js withFileTypes='false' dir='lib' n=10 -0.12 % ±3.13% ±4.16% ±5.41%
fs/bench-readdirSync.js withFileTypes='false' dir='test/parallel' n=10 1.63 % ±3.17% ±4.23% ±5.51%
fs/bench-readdirSync.js withFileTypes='true' dir='lib' n=10 -0.85 % ±3.30% ±4.39% ±5.71%
fs/bench-readdirSync.js withFileTypes='true' dir='test/parallel' n=10 -0.68 % ±2.87% ±3.82% ±4.98%
fs/bench-readlinkSync.js n=1000 type='invalid' -2.76 % ±4.17% ±5.54% ±7.21%
fs/bench-readlinkSync.js n=1000 type='valid' 0.77 % ±1.93% ±2.57% ±3.36%
fs/bench-readSync.js n=10000 type='existing' 2.56 % ±2.78% ±3.73% ±4.90%
fs/bench-readSync.js n=10000 type='non-existing' 0.01 % ±0.92% ±1.23% ±1.60%
fs/bench-readvSync.js n=100000 type='invalid' 0.33 % ±0.57% ±0.75% ±0.98%
fs/bench-readvSync.js n=100000 type='valid' 0.51 % ±1.20% ±1.60% ±2.08%
fs/bench-realpath.js pathType='relative' n=10000 0.42 % ±1.07% ±1.42% ±1.85%
fs/bench-realpath.js pathType='resolved' n=10000 0.48 % ±1.01% ±1.34% ±1.75%
fs/bench-realpathSync.js pathType='relative' n=10000 ** -1.27 % ±0.85% ±1.14% ±1.48%
fs/bench-realpathSync.js pathType='resolved' n=10000 -0.48 % ±1.72% ±2.28% ±2.97%
fs/bench-renameSync.js n=2000 type='invalid' * -3.82 % ±3.66% ±4.88% ±6.37%
fs/bench-renameSync.js n=2000 type='valid' 0.34 % ±0.51% ±0.68% ±0.88%
fs/bench-rmdirSync.js n=10000 type='existing' -3.30 % ±4.38% ±5.87% ±7.73%
fs/bench-rmdirSync.js n=10000 type='non-existing' 0.83 % ±1.15% ±1.53% ±1.99%
fs/bench-stat-promise.js statType='fstat' n=200000 -0.54 % ±0.99% ±1.32% ±1.72%
fs/bench-stat-promise.js statType='lstat' n=200000 -0.23 % ±1.09% ±1.45% ±1.89%
fs/bench-stat-promise.js statType='stat' n=200000 -0.56 % ±0.97% ±1.29% ±1.68%
fs/bench-stat.js statType='fstat' n=200000 0.61 % ±1.37% ±1.83% ±2.38%
fs/bench-stat.js statType='lstat' n=200000 -0.69 % ±1.09% ±1.45% ±1.88%
fs/bench-stat.js statType='stat' n=200000 0.42 % ±1.23% ±1.63% ±2.12%
fs/bench-statSync-failure.js throwType='noThrow' statSyncType='lstatSync' n=10000 -1.31 % ±3.03% ±4.03% ±5.24%
fs/bench-statSync-failure.js throwType='noThrow' statSyncType='statSync' n=10000 0.34 % ±3.84% ±5.11% ±6.67%
fs/bench-statSync-failure.js throwType='throw' statSyncType='fstatSync' n=10000 0.17 % ±0.96% ±1.28% ±1.67%
fs/bench-statSync-failure.js throwType='throw' statSyncType='lstatSync' n=10000 0.68 % ±2.20% ±2.93% ±3.81%
fs/bench-statSync-failure.js throwType='throw' statSyncType='statSync' n=10000 1.51 % ±1.61% ±2.14% ±2.79%
fs/bench-statSync.js statSyncType='fstatSync' n=10000 -0.34 % ±2.33% ±3.09% ±4.02%
fs/bench-statSync.js statSyncType='lstatSync' n=10000 0.95 % ±3.20% ±4.26% ±5.54%
fs/bench-statSync.js statSyncType='statSync' n=10000 0.07 % ±1.57% ±2.09% ±2.73%
fs/bench-symlinkSync.js n=1000 type='invalid' 0.71 % ±3.61% ±4.80% ±6.24%
fs/bench-symlinkSync.js n=1000 type='valid' -0.80 % ±3.41% ±4.53% ±5.89%
fs/bench-timesSync.js n=1000 func='futimes' type='existing' -0.50 % ±5.05% ±6.71% ±8.72%
fs/bench-timesSync.js n=1000 func='futimes' type='non-existing' 1.75 % ±3.37% ±4.49% ±5.83%
fs/bench-timesSync.js n=1000 func='lutimes' type='existing' 0.10 % ±1.07% ±1.42% ±1.84%
fs/bench-timesSync.js n=1000 func='lutimes' type='non-existing' -0.47 % ±3.27% ±4.35% ±5.66%
fs/bench-timesSync.js n=1000 func='utimes' type='existing' 0.06 % ±0.94% ±1.25% ±1.63%
fs/bench-timesSync.js n=1000 func='utimes' type='non-existing' -1.15 % ±4.98% ±6.62% ±8.61%
fs/bench-unlinkSync.js n=1000 type='existing' -0.46 % ±0.66% ±0.88% ±1.15%
fs/bench-unlinkSync.js n=1000 type='non-existing' 1.24 % ±2.60% ±3.47% ±4.54%
fs/bench-writeFileSync.js n=1000 func='writeFile' useBuffer='false' length=1024 useFd='false' encoding='utf8' -13.17 % ±17.59% ±23.39% ±30.44%
fs/bench-writeFileSync.js n=1000 func='writeFile' useBuffer='false' length=1024 useFd='true' encoding='utf8' -0.09 % ±2.82% ±3.76% ±4.90%
fs/bench-writeFileSync.js n=1000 func='writeFile' useBuffer='false' length=102400 useFd='false' encoding='utf8' 1.16 % ±10.89% ±14.49% ±18.86%
fs/bench-writeFileSync.js n=1000 func='writeFile' useBuffer='false' length=102400 useFd='true' encoding='utf8' 0.57 % ±0.99% ±1.31% ±1.71%
fs/bench-writeFileSync.js n=1000 func='writeFile' useBuffer='false' length=1048576 useFd='false' encoding='utf8' 0.75 % ±17.97% ±23.89% ±31.06%
fs/bench-writeFileSync.js n=1000 func='writeFile' useBuffer='false' length=1048576 useFd='true' encoding='utf8' 0.21 % ±0.28% ±0.38% ±0.50%
fs/bench-writevSync.js n=100000 type='invalid' -0.04 % ±0.52% ±0.69% ±0.90%
fs/bench-writevSync.js n=100000 type='valid' * 0.73 % ±0.67% ±0.90% ±1.17%
fs/read-stream-throughput.js n=1024 highWaterMark=1024 filesize=1024000 encodingType='asc' * -0.74 % ±0.72% ±0.96% ±1.24%
fs/read-stream-throughput.js n=1024 highWaterMark=1024 filesize=1024000 encodingType='buf' -0.43 % ±0.98% ±1.30% ±1.69%
fs/read-stream-throughput.js n=1024 highWaterMark=1024 filesize=1024000 encodingType='utf' 0.01 % ±0.48% ±0.64% ±0.84%
fs/read-stream-throughput.js n=1024 highWaterMark=1048576 filesize=1024000 encodingType='asc' 0.82 % ±3.71% ±4.93% ±6.41%
fs/read-stream-throughput.js n=1024 highWaterMark=1048576 filesize=1024000 encodingType='buf' -20.09 % ±24.06% ±32.01% ±41.67%
fs/read-stream-throughput.js n=1024 highWaterMark=1048576 filesize=1024000 encodingType='utf' 0.02 % ±0.08% ±0.10% ±0.14%
fs/read-stream-throughput.js n=1024 highWaterMark=4096 filesize=1024000 encodingType='asc' * -0.63 % ±0.57% ±0.76% ±0.99%
fs/read-stream-throughput.js n=1024 highWaterMark=4096 filesize=1024000 encodingType='buf' -0.68 % ±1.41% ±1.87% ±2.44%
fs/read-stream-throughput.js n=1024 highWaterMark=4096 filesize=1024000 encodingType='utf' 0.11 % ±0.60% ±0.80% ±1.04%
fs/read-stream-throughput.js n=1024 highWaterMark=65535 filesize=1024000 encodingType='asc' 0.06 % ±2.06% ±2.73% ±3.55%
fs/read-stream-throughput.js n=1024 highWaterMark=65535 filesize=1024000 encodingType='buf' -2.08 % ±11.12% ±14.79% ±19.23%
fs/read-stream-throughput.js n=1024 highWaterMark=65535 filesize=1024000 encodingType='utf' -0.11 % ±0.40% ±0.53% ±0.69%
fs/readfile-partitioned.js concurrent=1 len=1024 encoding='' duration=5 0.00 % ±0.35% ±0.46% ±0.60%
fs/readfile-partitioned.js concurrent=1 len=1024 encoding='utf-8' duration=5 -0.19 % ±0.30% ±0.40% ±0.52%
fs/readfile-partitioned.js concurrent=1 len=16777216 encoding='' duration=5 0.10 % ±0.24% ±0.31% ±0.41%
fs/readfile-partitioned.js concurrent=1 len=16777216 encoding='utf-8' duration=5 0.77 % ±0.79% ±1.06% ±1.38%
fs/readfile-partitioned.js concurrent=10 len=1024 encoding='' duration=5 0.03 % ±0.74% ±0.99% ±1.29%
fs/readfile-partitioned.js concurrent=10 len=1024 encoding='utf-8' duration=5 -0.12 % ±1.01% ±1.34% ±1.74%
fs/readfile-partitioned.js concurrent=10 len=16777216 encoding='' duration=5 -0.54 % ±1.07% ±1.42% ±1.85%
fs/readfile-partitioned.js concurrent=10 len=16777216 encoding='utf-8' duration=5 -0.07 % ±0.23% ±0.30% ±0.39%
fs/readfile-permission-enabled.js concurrent=1 len=1024 encoding='' duration=5 0.61 % ±1.36% ±1.81% ±2.36%
fs/readfile-permission-enabled.js concurrent=1 len=1024 encoding='utf-8' duration=5 0.06 % ±1.52% ±2.02% ±2.63%
fs/readfile-permission-enabled.js concurrent=1 len=16777216 encoding='' duration=5 24.73 % ±34.05% ±45.33% ±59.05%
fs/readfile-permission-enabled.js concurrent=1 len=16777216 encoding='utf-8' duration=5 -0.01 % ±0.46% ±0.62% ±0.80%
fs/readfile-permission-enabled.js concurrent=10 len=1024 encoding='' duration=5 -0.20 % ±0.68% ±0.90% ±1.17%
fs/readfile-permission-enabled.js concurrent=10 len=1024 encoding='utf-8' duration=5 0.06 % ±0.77% ±1.02% ±1.33%
fs/readfile-permission-enabled.js concurrent=10 len=16777216 encoding='' duration=5 0.06 % ±1.96% ±2.61% ±3.39%
fs/readfile-permission-enabled.js concurrent=10 len=16777216 encoding='utf-8' duration=5 -0.26 % ±0.30% ±0.39% ±0.51%
fs/readfile-promises.js concurrent=1 len=1024 encoding='' duration=5 -0.14 % ±0.52% ±0.69% ±0.90%
fs/readfile-promises.js concurrent=1 len=1024 encoding='utf-8' duration=5 * 0.61 % ±0.51% ±0.68% ±0.88%
fs/readfile-promises.js concurrent=1 len=16777216 encoding='' duration=5 4.94 % ±20.11% ±26.75% ±34.78%
fs/readfile-promises.js concurrent=1 len=16777216 encoding='utf-8' duration=5 0.15 % ±0.26% ±0.34% ±0.44%
fs/readfile-promises.js concurrent=1 len=33554432 encoding='' duration=5 -0.23 % ±0.37% ±0.49% ±0.64%
fs/readfile-promises.js concurrent=1 len=33554432 encoding='utf-8' duration=5 0.06 % ±0.21% ±0.28% ±0.37%
fs/readfile-promises.js concurrent=1 len=4194304 encoding='' duration=5 -18.61 % ±27.55% ±36.68% ±47.76%
fs/readfile-promises.js concurrent=1 len=4194304 encoding='utf-8' duration=5 0.03 % ±0.26% ±0.34% ±0.44%
fs/readfile-promises.js concurrent=1 len=524288 encoding='' duration=5 5.79 % ±6.33% ±8.42% ±10.94%
fs/readfile-promises.js concurrent=1 len=524288 encoding='utf-8' duration=5 -0.14 % ±0.49% ±0.65% ±0.84%
fs/readfile-promises.js concurrent=1 len=8388608 encoding='' duration=5 -12.68 % ±26.92% ±35.79% ±46.52%
fs/readfile-promises.js concurrent=1 len=8388608 encoding='utf-8' duration=5 0.05 % ±0.23% ±0.31% ±0.41%
fs/readfile-promises.js concurrent=10 len=1024 encoding='' duration=5 1.19 % ±1.78% ±2.37% ±3.08%
fs/readfile-promises.js concurrent=10 len=1024 encoding='utf-8' duration=5 1.47 % ±2.34% ±3.11% ±4.04%
fs/readfile-promises.js concurrent=10 len=16777216 encoding='' duration=5 -0.44 % ±0.91% ±1.21% ±1.57%
fs/readfile-promises.js concurrent=10 len=16777216 encoding='utf-8' duration=5 * 0.21 % ±0.20% ±0.26% ±0.34%
fs/readfile-promises.js concurrent=10 len=33554432 encoding='' duration=5 0.46 % ±0.77% ±1.03% ±1.34%
fs/readfile-promises.js concurrent=10 len=33554432 encoding='utf-8' duration=5 * 0.17 % ±0.16% ±0.21% ±0.27%
fs/readfile-promises.js concurrent=10 len=4194304 encoding='' duration=5 -1.46 % ±1.72% ±2.29% ±2.98%
fs/readfile-promises.js concurrent=10 len=4194304 encoding='utf-8' duration=5 0.11 % ±0.32% ±0.43% ±0.56%
fs/readfile-promises.js concurrent=10 len=524288 encoding='' duration=5 3.15 % ±6.62% ±8.80% ±11.44%
fs/readfile-promises.js concurrent=10 len=524288 encoding='utf-8' duration=5 -0.12 % ±0.48% ±0.63% ±0.82%
fs/readfile-promises.js concurrent=10 len=8388608 encoding='' duration=5 -0.19 % ±0.99% ±1.32% ±1.72%
fs/readfile-promises.js concurrent=10 len=8388608 encoding='utf-8' duration=5 -0.07 % ±0.21% ±0.28% ±0.37%
fs/readfile.js concurrent=1 len=1024 encoding='' duration=5 -0.44 % ±1.49% ±1.98% ±2.58%
fs/readfile.js concurrent=1 len=1024 encoding='utf-8' duration=5 * -1.77 % ±1.48% ±1.97% ±2.56%
fs/readfile.js concurrent=1 len=16777216 encoding='' duration=5 -2.92 % ±29.62% ±39.38% ±51.19%
fs/readfile.js concurrent=1 len=16777216 encoding='utf-8' duration=5 -0.13 % ±0.49% ±0.65% ±0.85%
fs/readfile.js concurrent=10 len=1024 encoding='' duration=5 * -0.84 % ±0.78% ±1.04% ±1.35%
fs/readfile.js concurrent=10 len=1024 encoding='utf-8' duration=5 0.10 % ±0.87% ±1.16% ±1.51%
fs/readfile.js concurrent=10 len=16777216 encoding='' duration=5 * 2.32 % ±1.79% ±2.38% ±3.09%
fs/readfile.js concurrent=10 len=16777216 encoding='utf-8' duration=5 -0.06 % ±0.22% ±0.29% ±0.38%
fs/readFileSync.js n=10000 hasFileDescriptor='false' path='existing' encoding='undefined' 0.42 % ±0.97% ±1.30% ±1.69%
fs/readFileSync.js n=10000 hasFileDescriptor='false' path='existing' encoding='utf8' -1.26 % ±2.09% ±2.78% ±3.64%
fs/readFileSync.js n=10000 hasFileDescriptor='false' path='non-existing' encoding='undefined' 0.13 % ±1.35% ±1.80% ±2.34%
fs/readFileSync.js n=10000 hasFileDescriptor='false' path='non-existing' encoding='utf8' 0.10 % ±1.07% ±1.43% ±1.86%
fs/readFileSync.js n=10000 hasFileDescriptor='true' path='existing' encoding='undefined' 0.58 % ±2.54% ±3.38% ±4.40%
fs/readFileSync.js n=10000 hasFileDescriptor='true' path='existing' encoding='utf8' -2.21 % ±2.60% ±3.46% ±4.50%
fs/readFileSync.js n=10000 hasFileDescriptor='true' path='non-existing' encoding='undefined' -1.05 % ±2.48% ±3.29% ±4.28%
fs/readFileSync.js n=10000 hasFileDescriptor='true' path='non-existing' encoding='utf8' 0.24 % ±2.06% ±2.74% ±3.56%
fs/write-stream-throughput.js size=1024 encodingType='asc' dur=5 -8.63 % ±11.00% ±14.63% ±19.02%
fs/write-stream-throughput.js size=1024 encodingType='buf' dur=5 -4.67 % ±12.79% ±17.01% ±22.11%
fs/write-stream-throughput.js size=1024 encodingType='utf' dur=5 -0.07 % ±0.64% ±0.85% ±1.11%
fs/write-stream-throughput.js size=1048576 encodingType='asc' dur=5 -16.13 % ±17.05% ±22.93% ±30.33%
fs/write-stream-throughput.js size=1048576 encodingType='buf' dur=5 0.08 % ±21.28% ±28.30% ±36.79%
fs/write-stream-throughput.js size=1048576 encodingType='utf' dur=5 0.13 % ±0.76% ±1.02% ±1.32%
fs/write-stream-throughput.js size=2 encodingType='asc' dur=5 -0.14 % ±0.55% ±0.74% ±0.96%
fs/write-stream-throughput.js size=2 encodingType='buf' dur=5 -0.04 % ±0.23% ±0.30% ±0.39%
fs/write-stream-throughput.js size=2 encodingType='utf' dur=5 -0.17 % ±0.63% ±0.84% ±1.10%
fs/write-stream-throughput.js size=65535 encodingType='asc' dur=5 -4.76 % ±6.39% ±8.50% ±11.06%
fs/write-stream-throughput.js size=65535 encodingType='buf' dur=5 1.00 % ±6.70% ±8.92% ±11.59%
fs/write-stream-throughput.js size=65535 encodingType='utf' dur=5 0.55 % ±0.76% ±1.02% ±1.32%
fs/writefile-promises.js concurrent=1 size=1024 encodingType='asc' duration=5 -0.23 % ±1.16% ±1.54% ±2.01%
fs/writefile-promises.js concurrent=1 size=1024 encodingType='buf' duration=5 -0.37 % ±1.53% ±2.03% ±2.65%
fs/writefile-promises.js concurrent=1 size=1024 encodingType='utf' duration=5 0.18 % ±1.10% ±1.46% ±1.89%
fs/writefile-promises.js concurrent=1 size=1048576 encodingType='asc' duration=5 15.51 % ±31.87% ±42.38% ±55.11%
fs/writefile-promises.js concurrent=1 size=1048576 encodingType='buf' duration=5 -7.46 % ±15.13% ±20.11% ±26.15%
fs/writefile-promises.js concurrent=1 size=1048576 encodingType='utf' duration=5 -1.27 % ±1.36% ±1.81% ±2.37%
fs/writefile-promises.js concurrent=1 size=2 encodingType='asc' duration=5 -0.67 % ±1.23% ±1.64% ±2.13%
fs/writefile-promises.js concurrent=1 size=2 encodingType='buf' duration=5 -0.67 % ±1.53% ±2.03% ±2.64%
fs/writefile-promises.js concurrent=1 size=2 encodingType='utf' duration=5 * 1.19 % ±1.09% ±1.44% ±1.88%
fs/writefile-promises.js concurrent=1 size=65535 encodingType='asc' duration=5 -1.15 % ±15.51% ±20.62% ±26.81%
fs/writefile-promises.js concurrent=1 size=65535 encodingType='buf' duration=5 * -11.01 % ±10.43% ±13.88% ±18.07%
fs/writefile-promises.js concurrent=1 size=65535 encodingType='utf' duration=5 -0.21 % ±1.22% ±1.63% ±2.12%
fs/writefile-promises.js concurrent=10 size=1024 encodingType='asc' duration=5 -0.29 % ±1.21% ±1.61% ±2.10%
fs/writefile-promises.js concurrent=10 size=1024 encodingType='buf' duration=5 0.56 % ±1.09% ±1.45% ±1.89%
fs/writefile-promises.js concurrent=10 size=1024 encodingType='utf' duration=5 -0.13 % ±1.03% ±1.37% ±1.79%
fs/writefile-promises.js concurrent=10 size=1048576 encodingType='asc' duration=5 -0.28 % ±2.32% ±3.08% ±4.01%
fs/writefile-promises.js concurrent=10 size=1048576 encodingType='buf' duration=5 1.13 % ±2.44% ±3.24% ±4.21%
fs/writefile-promises.js concurrent=10 size=1048576 encodingType='utf' duration=5 -0.61 % ±1.26% ±1.68% ±2.20%
fs/writefile-promises.js concurrent=10 size=2 encodingType='asc' duration=5 0.72 % ±1.07% ±1.42% ±1.85%
fs/writefile-promises.js concurrent=10 size=2 encodingType='buf' duration=5 0.31 % ±1.28% ±1.71% ±2.23%
fs/writefile-promises.js concurrent=10 size=2 encodingType='utf' duration=5 0.16 % ±1.16% ±1.54% ±2.01%
fs/writefile-promises.js concurrent=10 size=65535 encodingType='asc' duration=5 0.44 % ±1.60% ±2.12% ±2.76%
fs/writefile-promises.js concurrent=10 size=65535 encodingType='buf' duration=5 0.24 % ±1.94% ±2.58% ±3.36%
fs/writefile-promises.js concurrent=10 size=65535 encodingType='utf' duration=5 ** -2.09 % ±1.42% ±1.89% ±2.46% FWIW 20% was observed only for |
@anonrig, given the benchmark results, do you think a secondary system w/o URL support should be added for the |
I'm -0.5 since benchmarks seem to have some impact, but I'd like to raise awareness before unblocking. cc @nodejs/tsc @nodejs/performance wdyt? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add an error hint where if someone calls a path method with a string URL (not an URL instance) we suggest that they wrap their input in new URL
? Basically if we’re about to throw anyway, if the input started with file:
then enrich the error with this suggestion.
IIRC It's possible for a file path to contain the |
I suspect this will thrown when using permission model |
I don't think that'll happen, as it's doing all the changes before any path processing really occurs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 2 referenced issues are 2 years old and 9 months old that didn't receive as much traffic to warrant for this change in an extremely important part of the Node.js core.
I prefer this function to not change the signature of the existing functions, if the request/need for the change is not warranting the cost of touching an extremely hot path. We might expose a different function that we don't rely on (internally), but I'm not sure.
I'm -1 on the proposed change as it is.
cc @nodejs/url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not convinced that this is a step in the right direction.
For example, isn't the second argument of the URL
constructor supposed to effectively do resolve()
(with the typical URL caveats)?
On a related note, normalize()
has a variety of issues because the resulting path is not necessary equivalent to the original path. Explicitly propagating these quirks to file URLs feels odd to me.
51d0607
to
7a98ac5
Compare
@@ -46,6 +46,14 @@ const { | |||
validateObject, | |||
validateString, | |||
} = require('internal/validators'); | |||
const { | |||
toPathIfFileURL: URLToPathIfFileURL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preferably, a variable with camelCasing. I can see its little complex as the existing functions already reserved the names.
However, something like getPathFromFileURL
or something similar would be nice to have.
This PR changes the path functions to support File URLs.
Related to #41521
Related to #49273
Successor of #52497