-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: add test-benchmark-assert #15174
Conversation
@@ -33,7 +33,8 @@ function main(conf) { | |||
const actual = new clazz(len); | |||
const expected = new clazz(len); | |||
const expectedWrong = Buffer.alloc(len); | |||
expectedWrong[100] = 123; | |||
const wrongIndex = Math.floor(n / 2); |
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.
did you intend to use len
?
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.
did you intend to use len?
@targos Yes, oops!
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 % comments.
@@ -27,6 +27,7 @@ function main(conf) { | |||
data.copy(expectedWrong); | |||
|
|||
switch (conf.method) { | |||
case '': |
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.
Would you be so kind and a a comment why this is necessary? Otherwise I would be confused by 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.
Done here and in the other 8 places it occurs in other files.
Ping @Trott |
`deepequal-typedarrays.js` throws if `len` is set to 100 or less due to a hardcoded index. Calculate the index based on `len` so benchmark can be run with small `len` values if desired.
The benchmarks for `assert` all take a `method` configuration option, but the allowable values are different across the files. For each benchmark, provide an arbitrary default if `method` is set to an empty string. This allows all the `assert` benchmarks to be run with a single command but only on a single method. This is primarily useful for testing that the assert benchmark files don't contain egregious errors. (In other words, it's useful for testing.)
Add minimal test for `assert` benchmarks.
I've refactored the test to use the |
`deepequal-typedarrays.js` throws if `len` is set to 100 or less due to a hardcoded index. Calculate the index based on `len` so benchmark can be run with small `len` values if desired. PR-URL: #15174 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
The benchmarks for `assert` all take a `method` configuration option, but the allowable values are different across the files. For each benchmark, provide an arbitrary default if `method` is set to an empty string. This allows all the `assert` benchmarks to be run with a single command but only on a single method. This is primarily useful for testing that the assert benchmark files don't contain egregious errors. (In other words, it's useful for testing.) PR-URL: #15174 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
Add minimal test for `assert` benchmarks. PR-URL: #15174 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
`deepequal-typedarrays.js` throws if `len` is set to 100 or less due to a hardcoded index. Calculate the index based on `len` so benchmark can be run with small `len` values if desired. PR-URL: nodejs/node#15174 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
The benchmarks for `assert` all take a `method` configuration option, but the allowable values are different across the files. For each benchmark, provide an arbitrary default if `method` is set to an empty string. This allows all the `assert` benchmarks to be run with a single command but only on a single method. This is primarily useful for testing that the assert benchmark files don't contain egregious errors. (In other words, it's useful for testing.) PR-URL: nodejs/node#15174 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
Add minimal test for `assert` benchmarks. PR-URL: nodejs/node#15174 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
This lands cleanly in v8.x-staging but the test fails because |
The benchmarks for `assert` all take a `method` configuration option, but the allowable values are different across the files. For each benchmark, provide an arbitrary default if `method` is set to an empty string. This allows all the `assert` benchmarks to be run with a single command but only on a single method. This is primarily useful for testing that the assert benchmark files don't contain egregious errors. (In other words, it's useful for testing.) PR-URL: #15174 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
`deepequal-typedarrays.js` throws if `len` is set to 100 or less due to a hardcoded index. Calculate the index based on `len` so benchmark can be run with small `len` values if desired. PR-URL: #15174 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
Add minimal test for `assert` benchmarks. PR-URL: #15174 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
`deepequal-typedarrays.js` throws if `len` is set to 100 or less due to a hardcoded index. Calculate the index based on `len` so benchmark can be run with small `len` values if desired. PR-URL: nodejs/node#15174 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
The benchmarks for `assert` all take a `method` configuration option, but the allowable values are different across the files. For each benchmark, provide an arbitrary default if `method` is set to an empty string. This allows all the `assert` benchmarks to be run with a single command but only on a single method. This is primarily useful for testing that the assert benchmark files don't contain egregious errors. (In other words, it's useful for testing.) PR-URL: nodejs/node#15174 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
Add minimal test for `assert` benchmarks. PR-URL: nodejs/node#15174 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
@jasnell It looks like you subsequently landed these, obviating the need for a backport. I'm going to remove the backport-requested label. Let me know if that's wrong and/or you need anything more from me on this. |
lts? |
If it lands cleanly, yes. If it doesn't, probably not worth it. |
This does not land cleanly in 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 |
@MylesBorins Is this supposed to be labeled |
@Trott indeed |
First commit:
Second commit:
Third commit:
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test benchmark assert