Skip to content

Commit 058181a

Browse files
committed
chore: clean up
1 parent dd8d9ce commit 058181a

File tree

21 files changed

+60
-40
lines changed

21 files changed

+60
-40
lines changed

packages/appconfig/__benchmarks__/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ const setupHandler = (options = {}) => {
4848
const coldHandler = setupHandler({ cacheExpiry: 0 })
4949
const warmHandler = setupHandler()
5050

51+
const event = {}
5152
await bench
52-
.add('without cache', async (event = {}) => {
53+
.add('without cache', async () => {
5354
try {
5455
await coldHandler(event, context)
5556
} catch (e) {}
5657
})
57-
.add('with cache', async (event = {}) => {
58+
.add('with cache', async () => {
5859
try {
5960
await warmHandler(event, context)
6061
} catch (e) {}

packages/cloudwatch-metrics/__benchmarks__/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ const setupHandler = (options = {}) => {
1515
const coldHandler = setupHandler({ cacheExpiry: 0 })
1616
const warmHandler = setupHandler()
1717

18+
const event = {}
1819
await bench
19-
.add('without cache', async (event = {}) => {
20+
.add('without cache', async () => {
2021
try {
2122
await coldHandler(event, context)
2223
} catch (e) {}
2324
})
24-
.add('with cache', async (event = {}) => {
25+
.add('with cache', async () => {
2526
try {
2627
await warmHandler(event, context)
2728
} catch (e) {}

packages/core/__benchmarks__/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ await bench
7676
.add('Warm Invocation', async () => {
7777
await warmHandler(event, context)
7878
})
79-
// .add('Warm Invocation * next', async (event = {}) => {
79+
// .add('Warm Invocation * next', async () => {
8080
// await warmNextHandler(event, context)
8181
// })
8282
.add('Warm Async Invocation', async () => {
@@ -85,14 +85,14 @@ await bench
8585
.add('Warm Invocation with disabled Timeout', async () => {
8686
await warmDisableTimeoutHandler(event, context)
8787
})
88-
// .add('Warm Invocation with disabled Timeout * next', async (event = {}) => {
88+
// .add('Warm Invocation with disabled Timeout * next', async () => {
8989
// await warmNextTimeoutHandler(event, context)
9090
// })
9191
// TODO StreamifyResponse
9292
.add('Warm Invocation with middleware', async () => {
9393
await warmMiddlewareHandler(event, context)
9494
})
95-
// .add('Warm Invocation with middleware * next', async (event = {}) => {
95+
// .add('Warm Invocation with middleware * next', async () => {
9696
// await warmNextMiddlewareHandler(event, context)
9797
// })
9898
.add('Warm Invocation with async middleware', async () => {

packages/do-not-wait-for-empty-event-loop/__benchmarks__/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ const setupHandler = () => {
1414

1515
const warmHandler = setupHandler()
1616

17+
const event = {}
1718
await bench
18-
.add('Change Context', async (event = {}) => {
19+
.add('Change Context', async () => {
1920
try {
2021
await warmHandler(event, context)
2122
} catch (e) {}

packages/dynamodb/__benchmarks__/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ const setupHandler = (options = {}) => {
3232
const coldHandler = setupHandler({ cacheExpiry: 0 })
3333
const warmHandler = setupHandler()
3434

35+
const event = {}
3536
await bench
36-
.add('without cache', async (event = {}) => {
37+
.add('without cache', async () => {
3738
try {
3839
await coldHandler(event, context)
3940
} catch (e) {}
4041
})
41-
.add('with cache', async (event = {}) => {
42+
.add('with cache', async () => {
4243
try {
4344
await warmHandler(event, context)
4445
} catch (e) {}

packages/error-logger/__benchmarks__/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ const setupHandler = () => {
1616

1717
const warmHandler = setupHandler()
1818

19+
const event = {}
1920
await bench
20-
.add('Catch Error', async (event = {}) => {
21+
.add('Catch Error', async () => {
2122
try {
2223
await warmHandler(event, context)
2324
} catch (e) {}

packages/http-content-encoding/__benchmarks__/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ const setupHandler = (options) => {
1717
const gzHandler = setupHandler({ preferredEncoding: 'gz' })
1818
const brHandler = setupHandler({ preferredEncoding: 'br' })
1919

20+
const event = {}
2021
await bench
21-
.add('gzip Response', async (event = {}) => {
22+
.add('gzip Response', async () => {
2223
try {
2324
await gzHandler(event, context)
2425
} catch (e) {}
2526
})
26-
.add('brotli Response', async (event = {}) => {
27+
.add('brotli Response', async () => {
2728
try {
2829
await brHandler(event, context)
2930
} catch (e) {}

packages/http-error-handler/__benchmarks__/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ const setupHandler = () => {
1616

1717
const warmHandler = setupHandler()
1818

19+
const event = {}
1920
await bench
20-
.add('Handle Error', async (event = {}) => {
21+
.add('Handle Error', async () => {
2122
try {
2223
await warmHandler(event, context)
2324
} catch (e) {}

packages/http-event-normalizer/__benchmarks__/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ const setupHandler = () => {
1414

1515
const warmHandler = setupHandler()
1616

17+
const event = {}
1718
await bench
18-
.add('Normalize Event', async (event = {}) => {
19+
.add('Normalize Event', async () => {
1920
try {
2021
await warmHandler(event, context)
2122
} catch (e) {}

packages/http-response-serializer/__benchmarks__/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ const setupHandler = () => {
3737

3838
const warmHandler = setupHandler()
3939

40+
const event = {}
4041
await bench
41-
.add('Serialize Response', async (event = {}) => {
42+
.add('Serialize Response', async () => {
4243
try {
4344
await warmHandler(event, context)
4445
} catch (e) {}

packages/http-security-headers/__benchmarks__/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ const setupHandler = () => {
1414

1515
const warmHandler = setupHandler()
1616

17+
const event = {}
1718
await bench
18-
.add('Add Headers', async (event = {}) => {
19+
.add('Add Headers', async () => {
1920
try {
2021
await warmHandler(event, context)
2122
} catch (e) {}

packages/rds-signer/__benchmarks__/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ const setupHandler = (options = {}) => {
2929
const coldHandler = setupHandler({ cacheExpiry: 0 })
3030
const warmHandler = setupHandler()
3131

32+
const event = {}
3233
await bench
33-
.add('without cache', async (event = {}) => {
34+
.add('without cache', async () => {
3435
try {
3536
await coldHandler(event, context)
3637
} catch (e) {}
3738
})
38-
.add('with cache', async (event = {}) => {
39+
.add('with cache', async () => {
3940
try {
4041
await warmHandler(event, context)
4142
} catch (e) {}

packages/s3/__benchmarks__/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ const setupHandler = (options = {}) => {
3434
const coldHandler = setupHandler({ cacheExpiry: 0 })
3535
const warmHandler = setupHandler()
3636

37+
const event = {}
3738
await bench
38-
.add('without cache', async (event = {}) => {
39+
.add('without cache', async () => {
3940
try {
4041
await coldHandler(event, context)
4142
} catch (e) {}
4243
})
43-
.add('with cache', async (event = {}) => {
44+
.add('with cache', async () => {
4445
try {
4546
await warmHandler(event, context)
4647
} catch (e) {}

packages/secrets-manager/__benchmarks__/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ const setupHandler = (options = {}) => {
2929
const coldHandler = setupHandler({ cacheExpiry: 0 })
3030
const warmHandler = setupHandler()
3131

32+
const event = {}
3233
await bench
33-
.add('without cache', async (event = {}) => {
34+
.add('without cache', async () => {
3435
try {
3536
await coldHandler(event, context)
3637
} catch (e) {}
3738
})
38-
.add('with cache', async (event = {}) => {
39+
.add('with cache', async () => {
3940
try {
4041
await warmHandler(event, context)
4142
} catch (e) {}

packages/service-discovery/__benchmarks__/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ const setupHandler = (options = {}) => {
4242
const coldHandler = setupHandler({ cacheExpiry: 0 })
4343
const warmHandler = setupHandler()
4444

45+
const event = {}
4546
await bench
46-
.add('without cache', async (event = {}) => {
47+
.add('without cache', async () => {
4748
try {
4849
await coldHandler(event, context)
4950
} catch (e) {}
5051
})
51-
.add('with cache', async (event = {}) => {
52+
.add('with cache', async () => {
5253
try {
5354
await warmHandler(event, context)
5455
} catch (e) {}

packages/sqs-partial-batch-failure/__benchmarks__/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const context = {
99
}
1010
const setupHandler = () => {
1111
const baseHandler = (event) => {
12-
const recordPromises = event.Records.map(async (record, index) => {
13-
return record
12+
const recordPromises = event.Records.map((record, index) => {
13+
return Promise.resolve(record)
1414
})
1515
return Promise.allSettled(recordPromises)
1616
}
@@ -19,13 +19,15 @@ const setupHandler = () => {
1919

2020
const warmHandler = setupHandler()
2121

22+
const event = {
23+
Records: [{}]
24+
}
2225
await bench
23-
.add('process failures', async (event = {}) => {
26+
.add('process failures', async () => {
2427
try {
2528
await warmHandler(event, context)
2629
} catch (e) {}
2730
})
28-
2931
.run()
3032

3133
console.table(bench.table())

packages/ssm/__benchmarks__/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ const setupHandler = (options = {}) => {
3232
const coldHandler = setupHandler({ cacheExpiry: 0 })
3333
const warmHandler = setupHandler()
3434

35+
const event = {}
3536
await bench
36-
.add('without cache', async (event = {}) => {
37+
.add('without cache', async () => {
3738
try {
3839
await coldHandler(event, context)
3940
} catch (e) {}
4041
})
41-
.add('with cache', async (event = {}) => {
42+
.add('with cache', async () => {
4243
try {
4344
await warmHandler(event, context)
4445
} catch (e) {}

packages/sts/__benchmarks__/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ const setupHandler = (options = {}) => {
3232
const coldHandler = setupHandler({ cacheExpiry: 0 })
3333
const warmHandler = setupHandler()
3434

35+
const event = {}
3536
await bench
36-
.add('without cache', async (event = {}) => {
37+
.add('without cache', async () => {
3738
try {
3839
await coldHandler(event, context)
3940
} catch (e) {}
4041
})
41-
.add('with cache', async (event = {}) => {
42+
.add('with cache', async () => {
4243
try {
4344
await warmHandler(event, context)
4445
} catch (e) {}

packages/util/__benchmarks__/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ import {
1010
const bench = new Bench({ time: 1_000 })
1111

1212
await bench
13-
.add('getInternal', async (event = {}) => {
13+
.add('getInternal', async () => {
1414
await getInternal(true, {
1515
internal: {
1616
key: Promise.resolve('value')
1717
}
1818
})
1919
})
20-
.add('processCache', async (event = {}) => {
20+
.add('processCache', async () => {
2121
await processCache({ cacheExpiry: -1, cacheKey: 'key' })
2222
})
23-
.add('jsonSafeParse', async (event = {}) => {
23+
.add('jsonSafeParse', async () => {
2424
await jsonSafeParse('{"key":"value"}')
2525
})
26-
.add('normalizeHttpResponse', async (event = {}) => {
26+
.add('normalizeHttpResponse', async () => {
2727
await normalizeHttpResponse({})
2828
})
2929

packages/validator/__benchmarks__/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ const setupHandler = () => {
2020

2121
const warmHandler = setupHandler()
2222

23+
const event = {}
2324
await bench
24-
.add('type check input & output', async (event = {}) => {
25+
.add('type check input & output', async () => {
2526
try {
2627
await warmHandler(event, context)
2728
} catch (e) {}

packages/ws-response/__benchmarks__/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ const setupHandler = (options = {}) => {
2929
const coldHandler = setupHandler({ cacheExpiry: 0 })
3030
const warmHandler = setupHandler()
3131

32+
const event = {}
3233
await bench
33-
.add('without cache', async (event = {}) => {
34+
.add('without cache', async () => {
3435
try {
3536
await coldHandler(event, context)
3637
} catch (e) {}
3738
})
38-
.add('with cache', async (event = {}) => {
39+
.add('with cache', async () => {
3940
try {
4041
await warmHandler(event, context)
4142
} catch (e) {}

0 commit comments

Comments
 (0)