File tree Expand file tree Collapse file tree 6 files changed +4
-92
lines changed Expand file tree Collapse file tree 6 files changed +4
-92
lines changed Original file line number Diff line number Diff line change 1
1
import type { WithCodSpeedSuite } from "@codspeed/benchmark.js-plugin" ;
2
- import { aBaz , baz } from "../../src/foobarbaz" ;
2
+ import { baz } from "../../src/foobarbaz" ;
3
3
4
4
export function registerFoobarbazBenchmarks ( suite : WithCodSpeedSuite ) {
5
5
suite
@@ -9,12 +9,4 @@ export function registerFoobarbazBenchmarks(suite: WithCodSpeedSuite) {
9
9
. add ( "test sync baz 100" , ( ) => {
10
10
baz ( 100 ) ;
11
11
} ) ;
12
-
13
- suite
14
- . add ( "test async baz 10" , async ( ) => {
15
- await aBaz ( 10 ) ;
16
- } )
17
- . add ( "test async baz 100" , async ( ) => {
18
- await aBaz ( 100 ) ;
19
- } ) ;
20
12
}
Original file line number Diff line number Diff line change 1
1
import { Bench } from "tinybench" ;
2
- import { aBaz , baz } from "../../src/foobarbaz" ;
2
+ import { baz } from "../../src/foobarbaz" ;
3
3
4
4
export function registerFoobarbazBenchmarks ( bench : Bench ) {
5
5
bench
@@ -9,12 +9,4 @@ export function registerFoobarbazBenchmarks(bench: Bench) {
9
9
. add ( "test sync baz 100" , ( ) => {
10
10
baz ( 100 ) ;
11
11
} ) ;
12
-
13
- bench
14
- . add ( "test async baz 10" , async ( ) => {
15
- await aBaz ( 10 ) ;
16
- } )
17
- . add ( "test async baz 100" , async ( ) => {
18
- await aBaz ( 100 ) ;
19
- } ) ;
20
12
}
Original file line number Diff line number Diff line change @@ -14,31 +14,3 @@ function bar(n: number) {
14
14
export function baz ( n : number ) {
15
15
bar ( n ) ;
16
16
}
17
-
18
- // Async version
19
- function dummyThingToAwait ( ) {
20
- return new Promise < void > ( ( resolve ) => {
21
- process . nextTick ( ( ) => {
22
- resolve ( ) ;
23
- } ) ;
24
- } ) ;
25
- }
26
-
27
- async function aFoo ( n : number ) {
28
- await dummyThingToAwait ( ) ;
29
- let result = 0 ;
30
- for ( let i = 0 ; i < n ; i ++ ) {
31
- result += 1 ;
32
- }
33
- return result ;
34
- }
35
-
36
- async function aBar ( n : number ) {
37
- await dummyThingToAwait ( ) ;
38
- await aFoo ( n ) ;
39
- }
40
-
41
- export async function aBaz ( n : number ) {
42
- await dummyThingToAwait ( ) ;
43
- await aBar ( n ) ;
44
- }
Original file line number Diff line number Diff line change 1
1
import type { WithCodSpeedSuite } from "@codspeed/benchmark.js-plugin" ;
2
- import { aBaz , baz } from "../../src/foobarbaz" ;
2
+ import { baz } from "../../src/foobarbaz" ;
3
3
4
4
export function registerFoobarbazBenchmarks ( suite : WithCodSpeedSuite ) {
5
5
suite
@@ -9,12 +9,4 @@ export function registerFoobarbazBenchmarks(suite: WithCodSpeedSuite) {
9
9
. add ( "test sync baz 100" , ( ) => {
10
10
baz ( 100 ) ;
11
11
} ) ;
12
-
13
- suite
14
- . add ( "test async baz 10" , async ( ) => {
15
- await aBaz ( 10 ) ;
16
- } )
17
- . add ( "test async baz 100" , async ( ) => {
18
- await aBaz ( 100 ) ;
19
- } ) ;
20
12
}
Original file line number Diff line number Diff line change 1
1
import { Bench } from "tinybench" ;
2
- import { aBaz , baz } from "../../src/foobarbaz" ;
2
+ import { baz } from "../../src/foobarbaz" ;
3
3
4
4
export function registerFoobarbazBenchmarks ( bench : Bench ) {
5
5
bench
@@ -9,12 +9,4 @@ export function registerFoobarbazBenchmarks(bench: Bench) {
9
9
. add ( "test sync baz 100" , ( ) => {
10
10
baz ( 100 ) ;
11
11
} ) ;
12
-
13
- bench
14
- . add ( "test async baz 10" , async ( ) => {
15
- await aBaz ( 10 ) ;
16
- } )
17
- . add ( "test async baz 100" , async ( ) => {
18
- await aBaz ( 100 ) ;
19
- } ) ;
20
12
}
Original file line number Diff line number Diff line change @@ -14,31 +14,3 @@ function bar(n: number) {
14
14
export function baz ( n : number ) {
15
15
bar ( n ) ;
16
16
}
17
-
18
- // Async version
19
- function dummyThingToAwait ( ) {
20
- return new Promise < void > ( ( resolve ) => {
21
- process . nextTick ( ( ) => {
22
- resolve ( ) ;
23
- } ) ;
24
- } ) ;
25
- }
26
-
27
- async function aFoo ( n : number ) {
28
- await dummyThingToAwait ( ) ;
29
- let result = 0 ;
30
- for ( let i = 0 ; i < n ; i ++ ) {
31
- result += 1 ;
32
- }
33
- return result ;
34
- }
35
-
36
- async function aBar ( n : number ) {
37
- await dummyThingToAwait ( ) ;
38
- await aFoo ( n ) ;
39
- }
40
-
41
- export async function aBaz ( n : number ) {
42
- await dummyThingToAwait ( ) ;
43
- await aBar ( n ) ;
44
- }
You can’t perform that action at this time.
0 commit comments