Uh oh!
There was an error while loading. Please reload this page.
buffer: removed unused variable conf from buffer-base64-decode & buffer-base64-encode - #10175
buffer: removed unused variable conf from buffer-base64-decode & buffer-base64-encode#10175troy0820 wants to merge 4 commits into
Conversation
mscdex
commented
Dec 8, 2016
I'm not sure it's worth removing. Benchmarks like this probably should have defined parameters containing defaults of at least the currently used values. |
@mscdex Does this mean you would endorse (or at least not object to) a change from this: varbench=common.createBenchmark(main,{});functionmain(conf){varN=64*1024*1024;varb=Buffer.allocUnsafe(N);vars='';vari;for(i=0;i<256;++i)s+=String.fromCharCode(i);for(i=0;i<N;i+=256)b.write(s,i,256,'ascii');bench.start();for(i=0;i<32;++i)b.toString('base64');bench.end(64);}...to something more like this?: varbench=common.createBenchmark(main,{N: [64*1024*1024],});functionmain(conf){varN=+conf.N;varb=Buffer.allocUnsafe(N);vars='';vari;for(i=0;i<256;++i)s+=String.fromCharCode(i);for(i=0;i<N;i+=256)b.write(s,i,256,'ascii');bench.start();for(i=0;i<32;++i)b.toString('base64');bench.end(64);} |
mscdex
commented
Dec 8, 2016
@Trott Pretty much, although the iteration count might be configurable as well like with most other benchmarks. |
troy0820
commented
Dec 8, 2016
mscdex
commented
Dec 8, 2016
@troy0820 I think it would be better, yes. Just make sure to also add a parameter for the number of iterations (usually lowercase |
Trott
commented
Dec 8, 2016
@mscdex That would be the number of iterations in the loop between |
@Trott Correct. I don't know why 64 was being passed in the encode benchmark, it should be the loop count which is 32. |
Trott
commented
Dec 8, 2016
@troy0820 You up for making those changes as described above and trying to ascertain what the similar changes might be for the other file? (I'd guess just the iterations and nothing else in that file, but take a look and judge for yourself.) |
@Trott Yeah I can make those changes. It sounds like it's the above snippet along with the only change being the 32 in the |
Trott
commented
Dec 8, 2016
@troy0820 You'll want to add an |
bb1f3b1 to
a2af2c7Comparetroy0820
commented
Dec 8, 2016
There was a problem hiding this comment.
We might want to give this a better name to avoid confusion. I think other benchmarks use names like len, which I would be fine with.
There was a problem hiding this comment.
Similarly for these, the values should be prefixed with + to ensure they are numbers.
There was a problem hiding this comment.
Sorry, I meant this parameter should be called len. n should stay the same.
ac30244 to
3edffd5CompareThere was a problem hiding this comment.
Is the change from 64 to 32 in the bench.end(n) here intentional?
There was a problem hiding this comment.
Nevermind... just spotted the other comment about it :-)
jasnell
commented
Dec 23, 2016
Ping @mscdex |
There was a problem hiding this comment.
This should be const n = +conf.n;
There was a problem hiding this comment.
This should be const len = +conf.len;
There was a problem hiding this comment.
This should be const b = Buffer.allocUnsafe(len);
3edffd5 to
ad77d92Comparetroy0820
commented
Dec 23, 2016
Rebased master and made changes @mscdex |
mscdex
commented
Dec 23, 2016
LGTM |
Trott
commented
Dec 23, 2016
Only relevant CI job for this is the linter, so here it is: |
…on in buffer-base64-encode & buffer-base64-decode.js
ad77d92 to
8f096dbCompareTrott
commented
Dec 23, 2016
Hmmm, the linter failed, but that might have been because it needed a rebase, which I just did. Let's try again... |
Trott
commented
Dec 23, 2016
Linter is ✅ |
8f096db to
08cdc9cCompareAdd configuration object createBenchmark object for buffer size & iteration in buffer-base64-encode & buffer-base64-decode.js. PR-URL: nodejs#10175 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
Trott
commented
Dec 23, 2016
Add configuration object createBenchmark object for buffer size & iteration in buffer-base64-encode & buffer-base64-decode.js. PR-URL: #10175 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
Add configuration object createBenchmark object for buffer size & iteration in buffer-base64-encode & buffer-base64-decode.js. PR-URL: #10175 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
Add configuration object createBenchmark object for buffer size & iteration in buffer-base64-encode & buffer-base64-decode.js. PR-URL: #10175 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
Add configuration object createBenchmark object for buffer size & iteration in buffer-base64-encode & buffer-base64-decode.js. PR-URL: #10175 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
Add configuration object createBenchmark object for buffer size & iteration in buffer-base64-encode & buffer-base64-decode.js. PR-URL: #10175 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
Removed unused variable
conffrom buffer-base64-decode.js and buffer-based64-encode.jsChecklist
make -j8 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
Buffer
Description of change
Deleted variable that wasn't used which was
conf