Uh oh!
There was an error while loading. Please reload this page.
benchmark: add assert.deep[Strict]Equal benchmarks - #11092
Conversation
6886e9c to
4189118CompareThere was a problem hiding this comment.
In other benchmarks we've used the pattern:
switch(conf.strict){case'strict':
/** do stuff **/case'nonstrict':
/** do stuff **/default:
thrownewError('Unsupported method');}This makes it easier to plug in new choices later and makes a code a bit easier to follow
There was a problem hiding this comment.
It's also possible to simplify this further by doing something like:
varmethod;switch(conf.strict){case'strict':
method=assert.deepStrictEqual;break;case'nonstrict':
method=assert.deepEqual;break;default:
thrownewError('...');}bench.start();for(i=0;i<n;++i)method(actual,expected);bench.end(n);Or even:
constmethods={'strict': assert.deepStrictEqual,'nonstrict': assert.deepEqual};constmethod=methods[conf.strict];if(!method)thrownewError('...');bench.start();for(i=0;i<n;++i)method(actual,expected);bench.end(n);4189118 to
f26fa6aCompare* Move numbers into configuration * Add buffer comparison benchmark * Add assert.deepStrictEqual benchmarks
joyeecheung
commented
Feb 1, 2017
@jasnell Thanks for the review, updated, PTAL. |
joyeecheung
commented
Feb 2, 2017
Aside: one of the try runs of |
jasnell
commented
Feb 2, 2017
hmm... I'm not sure I'm seeing that. Worth pinging @nodejs/v8 tho just in case. |
FYI: I was playing with different |
joyeecheung
commented
Feb 2, 2017
joyeecheung
commented
Feb 4, 2017
Going to land this in 24 hours |
joyeecheung
commented
Feb 6, 2017
Landed in 5e4545e |
* Move numbers into configuration * Add buffer comparison benchmark * Add assert.deepStrictEqual benchmarks PR-URL: #11092 Reviewed-By: James M Snell <jasnell@gmail.com>
* Move numbers into configuration * Add buffer comparison benchmark * Add assert.deepStrictEqual benchmarks PR-URL: #11092 Reviewed-By: James M Snell <jasnell@gmail.com>
* Move numbers into configuration * Add buffer comparison benchmark * Add assert.deepStrictEqual benchmarks PR-URL: nodejs#11092 Reviewed-By: James M Snell <jasnell@gmail.com>
* Move numbers into configuration * Add buffer comparison benchmark * Add assert.deepStrictEqual benchmarks PR-URL: nodejs#11092 Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell
commented
Mar 7, 2017
would need a backport PR to land on v4 |
* Move numbers into configuration * Add buffer comparison benchmark * Add assert.deepStrictEqual benchmarks PR-URL: #11092 Reviewed-By: James M Snell <jasnell@gmail.com>
* Move numbers into configuration * Add buffer comparison benchmark * Add assert.deepStrictEqual benchmarks PR-URL: #11092 Reviewed-By: James M Snell <jasnell@gmail.com>
Refs: #10282 (review)
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
benchmark, assert