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

test: added fs benchmark #16049

Closed
wants to merge 2 commits into from
Closed

Conversation

ctdio
Copy link
Contributor

@ctdio ctdio commented Oct 6, 2017

Had to make the filesize configurable for the read-stream-throughput benchmark since the default was quite large and ended up causing the test to timeout.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added benchmark Issues and PRs related to the benchmark subsystem. fs Issues and PRs related to the fs subsystem / file system. test Issues and PRs related to the tests. labels Oct 6, 2017
@ctdio ctdio force-pushed the add-test-benchmark-fs branch from a404e56 to 77bfcd2 Compare October 6, 2017 20:43
@Trott Trott added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Oct 6, 2017
"size=1",
"dur=1",
"filesize=1024"
]);
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@refack
Copy link
Contributor

refack commented Oct 6, 2017

Weclome @charlieduong94 and thank you for the contribution 🥇

Quick CI: https://ci.nodejs.org/job/node-test-commit-linuxone/9059 ✔️
https://ci.nodejs.org/job/node-test-linter/12275/

@ctdio ctdio force-pushed the add-test-benchmark-fs branch from 77bfcd2 to 720abb0 Compare October 6, 2017 23:17
size: [1024, 4096, 65535, 1024 * 1024]
});

function main(conf) {
type = conf.type;
size = +conf.size;
filesize = conf.filesize
Copy link
Contributor

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

Copy link
Contributor Author

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.
@ctdio ctdio force-pushed the add-test-benchmark-fs branch from d62e0c1 to 1c173ae Compare October 6, 2017 23:49
@benjamingr
Copy link
Member

Copy link
Member

@benjamingr benjamingr left a 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!

Copy link
Contributor

@evanlucas evanlucas left a comment

Choose a reason for hiding this comment

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

Thanks!

Trott pushed a commit to Trott/io.js that referenced this pull request Oct 11, 2017
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>
@Trott
Copy link
Member

Trott commented Oct 11, 2017

Landed in 58d26e2.
Thanks for the contribution! 🎉

@Trott Trott closed this Oct 11, 2017
addaleax pushed a commit to addaleax/ayo that referenced this pull request Oct 12, 2017
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>
targos pushed a commit that referenced this pull request Oct 18, 2017
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>
@MylesBorins
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Issues and PRs related to the benchmark subsystem. code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. fs Issues and PRs related to the fs subsystem / file system. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants