-
Notifications
You must be signed in to change notification settings - Fork 30k
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
test: added fs benchmark #16049
test: added fs benchmark #16049
Conversation
a404e56
to
77bfcd2
Compare
test/parallel/test-benchmark-fs.js
Outdated
"size=1", | ||
"dur=1", | ||
"filesize=1024" | ||
]); |
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.
Is the CI passing here? I would expect it to fail for e.g. benchmark/fs/bench-realpath.js
as it requires a type that is not set here.
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 benchmark will run with the default values given to common.createBenchmark
for any argument that is not specified. So in the case of benchmark/fs/bench-realpath.js
, both the relative
and resolved
types are being run. I figured that since the purpose of pulling these benchmarks into the test suite was to ensure they don't break, it would be good to go through each of the code paths.
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.
Hello @charlieduong94,
What you say is true, and ideally that is what we would want, but that make this a very long test, and we are trying to strike a balance between coverage and manageability of the test suite.
Running this test on our fastest machine took 10 seconds (ignore the _ms
in the log)
ok 242 parallel/test-benchmark-fs
---
duration_ms: 10.107
...
I'm assuming that if we run this on only a single type it should take ~33% of that time. (Personally I'd pick buf
)
Anyway this is a good PR, so thank you very much.
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 can make that change if you would like. Some minor changes will need to be made to the read-stream-throughput
benchmark to get the type
arg to play nicely with each other.
Weclome @charlieduong94 and thank you for the contribution 🥇 Quick CI: https://ci.nodejs.org/job/node-test-commit-linuxone/9059 ✔️ |
77bfcd2
to
720abb0
Compare
size: [1024, 4096, 65535, 1024 * 1024] | ||
}); | ||
|
||
function main(conf) { | ||
type = conf.type; | ||
size = +conf.size; | ||
filesize = conf.filesize |
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.
Linter shows this line is missing a semicolon.
not ok 5 - /usr/home/iojs/build/workspace/node-test-linter/benchmark/fs/read-stream-throughput.js
---
message: Missing semicolon.
severity: error
data:
line: 21
column: 27
ruleId: semi
...
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.
Sorry, just pushed the fix
Modified fs benchmarks to use more unique args to avoid collision.
d62e0c1
to
1c173ae
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.
Thanks for doing this!
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.
Thanks!
Modified fs benchmarks to use more unique args to avoid collision. PR-URL: nodejs#16049 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Landed in 58d26e2. |
Modified fs benchmarks to use more unique args to avoid collision. PR-URL: nodejs/node#16049 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Modified fs benchmarks to use more unique args to avoid collision. PR-URL: #16049 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
This does not land cleanly in v6.x LTS. Please feel free to manually backport by following the guide. Please also feel free to replace do-not-land if it is being backported |
Had to make the
filesize
configurable for theread-stream-throughput
benchmark since the default was quite large and ended up causing the test to timeout.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes