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 11import type { WithCodSpeedSuite } from "@codspeed/benchmark.js-plugin" ;
2- import { aBaz , baz } from "../../src/foobarbaz" ;
2+ import { baz } from "../../src/foobarbaz" ;
33
44export function registerFoobarbazBenchmarks ( suite : WithCodSpeedSuite ) {
55 suite
@@ -9,12 +9,4 @@ export function registerFoobarbazBenchmarks(suite: WithCodSpeedSuite) {
99 . add ( "test sync baz 100" , ( ) => {
1010 baz ( 100 ) ;
1111 } ) ;
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- } ) ;
2012}
Original file line number Diff line number Diff line change 11import { Bench } from "tinybench" ;
2- import { aBaz , baz } from "../../src/foobarbaz" ;
2+ import { baz } from "../../src/foobarbaz" ;
33
44export function registerFoobarbazBenchmarks ( bench : Bench ) {
55 bench
@@ -9,12 +9,4 @@ export function registerFoobarbazBenchmarks(bench: Bench) {
99 . add ( "test sync baz 100" , ( ) => {
1010 baz ( 100 ) ;
1111 } ) ;
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- } ) ;
2012}
Original file line number Diff line number Diff line change @@ -14,31 +14,3 @@ function bar(n: number) {
1414export function baz ( n : number ) {
1515 bar ( n ) ;
1616}
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 11import type { WithCodSpeedSuite } from "@codspeed/benchmark.js-plugin" ;
2- import { aBaz , baz } from "../../src/foobarbaz" ;
2+ import { baz } from "../../src/foobarbaz" ;
33
44export function registerFoobarbazBenchmarks ( suite : WithCodSpeedSuite ) {
55 suite
@@ -9,12 +9,4 @@ export function registerFoobarbazBenchmarks(suite: WithCodSpeedSuite) {
99 . add ( "test sync baz 100" , ( ) => {
1010 baz ( 100 ) ;
1111 } ) ;
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- } ) ;
2012}
Original file line number Diff line number Diff line change 11import { Bench } from "tinybench" ;
2- import { aBaz , baz } from "../../src/foobarbaz" ;
2+ import { baz } from "../../src/foobarbaz" ;
33
44export function registerFoobarbazBenchmarks ( bench : Bench ) {
55 bench
@@ -9,12 +9,4 @@ export function registerFoobarbazBenchmarks(bench: Bench) {
99 . add ( "test sync baz 100" , ( ) => {
1010 baz ( 100 ) ;
1111 } ) ;
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- } ) ;
2012}
Original file line number Diff line number Diff line change @@ -14,31 +14,3 @@ function bar(n: number) {
1414export function baz ( n : number ) {
1515 bar ( n ) ;
1616}
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