-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
benchmark: Repair http chunked benchmark #7616
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
Conversation
benchmark/http/chunked.js
Outdated
| @@ -18,7 +18,7 @@ var bench = common.createBenchmark(main, { | ||
|
|
||
| function main(conf) { | ||
| const http = require('http'); | ||
| var chunk = Buffer.alloc(conf.size, '8'); | ||
| var chunk = Buffer.alloc(Number(conf.size), '8'); |
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.
Could you do +conf.size instead?
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.
+1
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.
Great. I've amended the previous commit.
|
LGTM with a slight comment. |
|
LGTM except for the nit raised by @cjihrig |
Cast to number the configuration size before passing it to the buffer constructor. Signed-off-by: Sorin Baltateanu <sorin.baltateanu@intel.com>
|
I have updated the pull request to include the suggested changes. Thanks. |
|
Actually, I just realized I fixed this as part of #7311. It would be great if we could get that PR landed as it is more comprehensive. It would be nice to have people add their input on that PR. |
|
@jasnell No. |
Checklist
make -j4 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
benchmark
Description of change
Cast to number the configuration size before passing it to the buffer constructor.
When running the http chunked benchmark the following exception occurs:
buffer.js:110
throw err;
^
TypeError: "size" argument must be a number
at Function.Buffer.alloc (buffer.js:119:3)
at Benchmark.main as fn
at Benchmark._run (/builds/2016-07-06_02-55-00/node/benchmark/common.js:139:17)
at /builds/2016-07-06_02-55-00/node/benchmark/common.js:96:10
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:577:11)
at run (bootstrap_node.js:340:7)
at startup (bootstrap_node.js:132:9)
at bootstrap_node.js:455:3
Signed-off-by: Sorin Baltateanu sorin.baltateanu@intel.com