Skip to content

Commit 523ba90

Browse files
authored
chore: upgrade benchmark to aws-cdk-lib v2.31.0 (#3650)
This is necessary as the previous benchark target had multiple occurrences of enums with several constants having the same value, which is now illegal in jsii code (#3207). The fix for this (aws/aws-cdk@7f4f150) was released in CDK 2.31.0.
1 parent 01c6d46 commit 523ba90

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

packages/@jsii/benchmarks/lib/constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import * as path from 'node:path';
22

33
export const fixturesDir = path.resolve(__dirname, '..', 'fixtures');
44

5-
export const cdkTagv2_21_1 = 'v2.21.1';
6-
export const cdkv2_21_1 = path.resolve(
5+
export const cdkTag = 'v2.31.0';
6+
export const cdk = path.resolve(
77
fixturesDir,
8-
`aws-cdk-lib@${cdkTagv2_21_1.replace(/\./g, '-')}.tgz`,
8+
`aws-cdk-lib@${cdkTag.replace(/\./g, '-')}.tgz`,
99
);

packages/@jsii/benchmarks/lib/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { Benchmark } from './benchmark';
2-
import { cdkTagv2_21_1 } from './constants';
2+
import { cdkTag } from './constants';
33
import * as awsCdkLib from './suite/aws-cdk-lib';
44

55
export const benchmarks = [
66
// Reference comparison using the TypeScript compiler
7-
new Benchmark(`Compile aws-cdk-lib@${cdkTagv2_21_1} (tsc)`)
7+
new Benchmark(`Compile aws-cdk-lib@${cdkTag} (tsc)`)
88
.setup(awsCdkLib.setup)
99
.beforeEach(awsCdkLib.beforeEach)
1010
.teardown(awsCdkLib.teardown)
1111
.subject(awsCdkLib.buildWithTsc),
1212

1313
// Always run against the same version of CDK source
14-
new Benchmark(`Compile aws-cdk-lib@${cdkTagv2_21_1}`)
14+
new Benchmark(`Compile aws-cdk-lib@${cdkTag}`)
1515
.setup(awsCdkLib.setup)
1616
.beforeEach(awsCdkLib.beforeEach)
1717
.teardown(awsCdkLib.teardown)

packages/@jsii/benchmarks/lib/suite/aws-cdk-lib/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as cp from 'node:child_process';
33
import * as os from 'node:os';
44
import * as path from 'node:path';
55

6-
import { cdkTagv2_21_1, cdkv2_21_1 } from '../../constants';
6+
import { cdkTag, cdk } from '../../constants';
77
import { inDirectory, streamUntar } from '../../util';
88

99
// Using the local `npm` package (from dependencies)
@@ -26,12 +26,12 @@ export async function setup(): Promise<Context> {
2626
const sourceDir = await fs.mkdtemp(
2727
path.join(os.tmpdir(), 'jsii-cdk-bench-snapshot'),
2828
);
29-
await streamUntar(cdkv2_21_1, { cwd: sourceDir });
29+
await streamUntar(cdk, { cwd: sourceDir });
3030
cp.execSync(`${npm} ci`, { cwd: sourceDir });
3131

3232
// Working directory for benchmark
3333
const workingDir = await fs.mkdtemp(
34-
path.join(os.tmpdir(), `tsc-cdk-bench@${cdkTagv2_21_1}`),
34+
path.join(os.tmpdir(), `tsc-cdk-bench@${cdkTag}`),
3535
);
3636

3737
return {

packages/@jsii/benchmarks/scripts/snapshot-package.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as path from 'node:path';
66
import * as tar from 'tar';
77
import * as ts from 'typescript';
88

9-
import { cdkTagv2_21_1, cdkv2_21_1 } from '../lib/constants';
9+
import { cdkTag, cdk, fixturesDir } from '../lib/constants';
1010

1111
// Using the local `npm` package (from dependencies)
1212
const npm = path.resolve(__dirname, '..', 'node_modules', '.bin', 'npm');
@@ -109,7 +109,8 @@ function snapshotAwsCdk(tag: string, file: string) {
109109
}
110110

111111
function main() {
112-
snapshotAwsCdk(cdkTagv2_21_1, cdkv2_21_1);
112+
fs.mkdirpSync(fixturesDir);
113+
snapshotAwsCdk(cdkTag, cdk);
113114
}
114115

115116
main();

0 commit comments

Comments
 (0)