Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix typescript benchmarks by removing ts-benchmark #12838

Merged
merged 5 commits into from Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/workflows/benchmark.yml
Expand Up @@ -34,10 +34,4 @@ jobs:

- run: node ./scripts/create-tarball.js

- run: npm install
working-directory: benchmarks/typescript/simple

- run: npx ts-benchmark -p ./ -f 17/110000 18 29 32 -b master -g -t --colors
working-directory: benchmarks/typescript/simple
env:
DB_URL: ${{ secrets.DB_URL }}
- run: npm run ts-benchmark
5 changes: 4 additions & 1 deletion benchmarks/typescript/simple/package.json
@@ -1,6 +1,9 @@
{
"dependencies": {
"mongoose": "file:../../../mongoose.tgz",
"typescript": "4.8.x"
"typescript": "4.9.x"
},
"scripts": {
"benchmark": "tsc --extendedDiagnostics"
}
}
6 changes: 2 additions & 4 deletions package.json
Expand Up @@ -61,9 +61,8 @@
"q": "1.5.1",
"sinon": "15.0.0",
"stream-browserify": "3.0.0",
"ts-benchmark": "^1.1.10",
"tsd": "0.25.0",
"typescript": "4.8.4",
"typescript": "4.9.4",
"uuid": "9.0.0",
"webpack": "5.75.0"
},
Expand Down Expand Up @@ -100,8 +99,7 @@
"test-tsd": "node ./test/types/check-types-filename && tsd",
"tdd": "mocha ./test/*.test.js --inspect --watch --recursive --watch-files ./**/*.{js,ts}",
"test-coverage": "nyc --reporter=html --reporter=text npm test",
"ts-benchmark": "ts-benchmark -p ./benchmarks/typescript/simple -f 17/110000 18 29 32",
"ts-benchmark-watch": "ts-benchmark -p ./benchmarks/typescript/simple -w ./types -i -s -f 17/100000 18 29 32 -b master"
"ts-benchmark": "cd ./benchmarks/typescript/simple && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check"
},
"main": "./index.js",
"types": "./types/index.d.ts",
Expand Down
15 changes: 15 additions & 0 deletions scripts/tsc-diagnostics-check.js
@@ -0,0 +1,15 @@
'use strict';

const fs = require('fs');

const stdin = fs.readFileSync(0).toString('utf8');
const maxInstantiations = isNaN(process.argv[2]) ? 100000 : +process.argv[2];
vkarpov15 marked this conversation as resolved.
Show resolved Hide resolved

console.log(stdin);

const numInstantiations = stdin.match(/Instantiations:\s+(\d+)/)[1];
vkarpov15 marked this conversation as resolved.
Show resolved Hide resolved
if (numInstantiations > maxInstantiations) {
throw new Error(`Instantiations ${numInstantiations} > max ${maxInstantiations}`);
}

process.exit(0);