https://github.com/danvk/ts-bench
Performance testing tool for the TypeScript compiler
https://github.com/danvk/ts-bench
Last synced: about 1 month ago
JSON representation
Performance testing tool for the TypeScript compiler
- Host: GitHub
- URL: https://github.com/danvk/ts-bench
- Owner: danvk
- Created: 2024-02-26T13:47:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-26T13:47:22.000Z (over 2 years ago)
- Last Synced: 2026-04-17T00:17:34.870Z (3 months ago)
- Language: Python
- Size: 36.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TypeScript Benchmark Test Harness
This script runs two versions of TypeScript against the same codebase to test for performance
differences. This was motivated by a desire to reproduce the "Compiler-Unions" benchmark for [TypeScript#57465].
Experiments are specified in JSON files, check out the [experiments](/experiments/) directory for for more examples.
```json
{
"description": "Compare PR branch to main",
"ref_control": "main",
"ref_exp": "pr-branch",
"command": "cd /Users/danvk/code/TypeScript-Compiler-Unions; npx hereby clean-src && node $tsc -b --emitDeclarationOnly false src/compiler --extendedDiagnostics",
"ts_dir": "/Users/danvk/github/TypeScript",
"num_runs": 8
}
```
Run via:
```sh
$ ./run.py experiments/branch-vs-main.json
...
Control: 31.82 +/- 1.92 s
Exp: 31.81 +/- 1.49 s = -0.05%
```
Runs are interleaved to try and reduce bias from whatever else your computer happens to be doing.
[TypeScript#57465]: https://github.com/microsoft/TypeScript/pull/57465