Skip to content

Commit c18cec7

Browse files
BridgeARcodebytere
authored andcommitted
benchmark: remove special test entries
It was necessary to have fallbacks to run the original tests. This is obsolete with the new test mode. PR-URL: #31396 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 19fbe55 commit c18cec7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+15
-81
lines changed

‎benchmark/assert/deepequal-buffer.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ const bench = common.createBenchmark(main,{
66
n: [2e4],
77
len: [1e2,1e3],
88
strict: [0,1],
9-
method: ['deepEqual','notDeepEqual'],
9+
method: ['deepEqual','notDeepEqual'],
1010
});
1111

1212
functionmain({ len, n, method, strict }){
13-
if(!method)
14-
method='deepEqual';
1513
constdata=Buffer.allocUnsafe(len+1);
1614
constactual=Buffer.alloc(len);
1715
constexpected=Buffer.alloc(len);

‎benchmark/assert/deepequal-map.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ function main({n, len, method, strict }){
3434
constarray=Array(len).fill(1);
3535

3636
switch(method){
37-
case'':
38-
// Empty string falls through to next line as default, mostly for tests.
3937
case'deepEqual_primitiveOnly': {
4038
constvalues=array.map((_,i)=>[`str_${i}`,123]);
4139
benchmark(strict ? deepStrictEqual : deepEqual,n,values);

‎benchmark/assert/deepequal-object.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const bench = common.createBenchmark(main,{
77
n: [5e3],
88
size: [1e2,1e3,5e4],
99
strict: [0,1],
10-
method: ['deepEqual','notDeepEqual'],
10+
method: ['deepEqual','notDeepEqual'],
1111
});
1212

1313
functioncreateObj(source,add=''){
@@ -27,9 +27,6 @@ function main({size, n, method, strict }){
2727
// TODO: Fix this "hack". `n` should not be manipulated.
2828
n=Math.min(Math.ceil(n/size),20);
2929

30-
if(!method)
31-
method='deepEqual';
32-
3330
constsource=Array.apply(null,Array(size));
3431
constactual=createObj(source);
3532
constexpected=createObj(source);

‎benchmark/assert/deepequal-prims-and-objs-big-array-set.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ function main({n, len, primitive, method, strict }){
5252
constexpectedWrongSet=newSet(expectedWrong);
5353

5454
switch(method){
55-
// Empty string falls through to next line as default, mostly for tests.
56-
case'':
5755
case'deepEqual_Array':
5856
run(strict ? deepStrictEqual : deepEqual,n,actual,expected);
5957
break;

‎benchmark/assert/deepequal-prims-and-objs-big-loop.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ const bench = common.createBenchmark(main,{
1313
primitive: Object.keys(primValues),
1414
n: [2e4],
1515
strict: [0,1],
16-
method: ['deepEqual','notDeepEqual'],
16+
method: ['deepEqual','notDeepEqual'],
1717
});
1818

1919
functionmain({ n, primitive, method, strict }){
20-
if(!method)
21-
method='deepEqual';
2220
constprim=primValues[primitive];
2321
constactual=prim;
2422
constexpected=prim;

‎benchmark/assert/deepequal-set.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ function main({n, len, method, strict }){
3434
constarray=Array(len).fill(1);
3535

3636
switch(method){
37-
case'':
38-
// Empty string falls through to next line as default, mostly for tests.
3937
case'deepEqual_primitiveOnly': {
4038
constvalues=array.map((_,i)=>`str_${i}`);
4139
benchmark(strict ? deepStrictEqual : deepEqual,n,values);

‎benchmark/assert/deepequal-typedarrays.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ const bench = common.createBenchmark(main,{
2020
});
2121

2222
functionmain({ type, n, len, method, strict }){
23-
if(!method)
24-
method='deepEqual';
2523
constclazz=global[type];
2624
constactual=newclazz(len);
2725
constexpected=newclazz(len);

‎benchmark/assert/throws.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ function main({n, method }){
1515
constmessage='failure';
1616

1717
switch(method){
18-
case'':
19-
// Empty string falls through to next line as default, mostly for tests.
2018
case'doesNotThrow':
2119
bench.start();
2220
for(leti=0;i<n;++i){

‎benchmark/buffers/buffer-bytelength.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ const chars = [
1717

1818
functionmain({ n, len, encoding }){
1919
letstrings=[];
20-
letresults=[len*16];
20+
letresults=[len*16];
2121
if(encoding==='buffer'){
22-
strings=[Buffer.alloc(len*16,'a')];
22+
strings=[Buffer.alloc(len*16,'a')];
2323
}else{
2424
for(conststringofchars){
2525
// Strings must be built differently, depending on encoding

‎benchmark/buffers/buffer-creation.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const bench = common.createBenchmark(main,{
1616
functionmain({ len, n, type }){
1717
letfn,i;
1818
switch(type){
19-
case'':
2019
case'fast-alloc':
2120
fn=Buffer.alloc;
2221
break;

0 commit comments

Comments
(0)