-
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,benchmark: have benchmark tests confirm that only one line of output is generated per benchmark file #21046
Conversation
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.
Amazing, thank you for working on this!!
test/common/benchmark.js
Outdated
child.on('exit', (code, signal) => { | ||
assert.strictEqual(code, 0); | ||
assert.strictEqual(signal, null); | ||
// This bit makes sure that each benchmark file is being sent settings such | ||
// that the benchmark file runs just one set of options. This helps keep the | ||
// benchmark tests from taking a long time to run. THerefore, each benchmark |
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.
Capitalization issue in "Therefore"
Hmmm...if I'm not mistaken, there is no build step for the C++ benchmark code in I'll probably have to create it because I don't think this will pass on Windows without it. Maybe someone with a Windows laptop at the Collaborator Summit would like to pair on this sometime today (or just do it without me and add your commit to this branch)? It will no doubt go a lot faster if we can build locally rather than having me guess at the write |
@apapirovski and anyone else: The first two commits here are the PR at #21032. It might simplify things a bit if those land first (and they should land anyway, independent of this), so feel free to review that PR and maybe give an approval for fast-tracking. Or not, and it will all land eventually. |
Argh, yeah, confirmed, fails on Windows because there's no build step for the C++ benchmark code. |
Instead of building |
This is now ready to go. Discussion with other Collaborators led to the conclusion that the benchmark C++ benchmark is of little or no value and should be deleted. |
test/common/benchmark.js
Outdated
|
||
let stdout = ''; | ||
child.stdout.on('data', (line) => { | ||
const thisLine = line.toString(); |
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.
Can we rather use child.stdout.setEncoding('utf8')
? That way we don’t have to explicitly convert + we handle multi-byte characters properly, if that should ever be an issue
Updated with nit from @addaleax. |
FYI part of #21072 proposes adding a new C++ benchmark for n-api function calls. |
Measuring call-into-native is relevant for N-API, because we have to measure up to plain V8 addons. For example, #21072 has revealed a potential near-halving (49%) of the overhead of calling into a N-API addon. |
Marking as |
@Trott I still think it's OK to skip the addon tests for now and leave a TODO there about making the build steps work. |
Prevent misc benchmark files from running more than one benchmark during tests.
Move C++ benchmark useful for NAPI to its own directory. This will isolate the benchmark so it can be excluded from testing that applies to all other benchmarks but not this one.
Check that benchmark tests are not running longer than necessary by confirming that they only produce one set of configs to report on per benchmark file.
I moved the function_call benchmark to its own directory ( |
CI is green, but I did move that one benchmark to its own directory since the last reviews, so it would be good if people who already approved this could indicate if this is still good by them... @apapirovski @jasnell @addaleax |
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.
Still LGTM :)
Prevent misc benchmark files from running more than one benchmark during tests. PR-URL: nodejs#21046 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Move C++ benchmark useful for NAPI to its own directory. This will isolate the benchmark so it can be excluded from testing that applies to all other benchmarks but not this one. PR-URL: nodejs#21046 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Check that benchmark tests are not running longer than necessary by confirming that they only produce one set of configs to report on per benchmark file. PR-URL: nodejs#21046 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Landed in 8944a4f...b72de3d |
Prevent misc benchmark files from running more than one benchmark during tests. PR-URL: #21046 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Move C++ benchmark useful for NAPI to its own directory. This will isolate the benchmark so it can be excluded from testing that applies to all other benchmarks but not this one. PR-URL: #21046 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Check that benchmark tests are not running longer than necessary by confirming that they only produce one set of configs to report on per benchmark file. PR-URL: #21046 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This required:
changing benchmark tests that produced more than one line of output per benchmark file to only produce one (which is what we've always wanted anyway)
add a build step to MakeFile to make sure thatdelete themisc/function_calls
benchmarkwill work; /cc @nodejs/buildmake it so the benchmark test module checks the output to make sure each file only produces one line of results
Whoops, just realized I forgot to add the build step to vcbuild.bat. Marking asin progress
for the moment until I fix that. (If someone wants to add a commit to the branch to do that, feel free to beat me to it. That would be awesome.)Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes