ts-benchmark
Installation:
npm i ts-benchmark -g
Description:
A command line interface for monitoring the performance of typescript.
Features:
- Ability to specify specific fields of benchmark result.
- Watcher which trigger benchmark process on any change made to the specified path.
- It can be use to benchmark two different branches.
Usage:
Benchmark the current directory:
ts-benchmark
Benchmark test folder which is test project and watch changes on src folder to trigger benchmark:
ts-benchmark -p ./test -w ./src
Like the previous command but it will shows specific fields of benchmark result instead of all fields:
ts-benchmark -p ./test -w ./src -f 17 18 29 32
Similar to the previous command but it will check if field 17 has reached the maximum valid value "10000":
ts-benchmark -p ./test -w ./src -f 17/10000 18 29 32
Benchmark test folder watch changes on src folder after benchmark master branch:
ts-benchmark -p ./test -w ./src -b master
Options:
| option |
description |
type |
default |
| -p, --path |
A relative path to project that will be benchmarked. |
string |
./ |
| -w, --watch |
A relative path to a directory or a file that trigger benchmark process on any changes. |
string |
undefined |
| -b, --branch |
Another git branch name to be benchmarked and compared with the current branch. |
string |
undefined |
| -s, --save |
To save and show the previous benchmark result. |
boolean |
false |
| -i, --initial |
To save and show the initial benchmark result. |
boolean |
false |
| -f, --fields |
To pick and show specific fields of benchmark result by its index numbers. Maximum valid valid can be set by adding "/" and then maximum value like: 17/10000 |
array of index numbers between 1-32 |
undefined |
| -g, --github |
To make the tool integrate with github workflow. "will throw error on failure if a field has overpassed its maximum valid value." |
boolean |
false |
| -t, --target |
Useful for benchmarking targeted branch of github pull request. -g flag should also be set to true as well." |
boolean |
false |
| --help |
Show help |
boolean |
false |
| --version |
Show version |
boolean |
false |
Fields indexes:
| index |
field |
index |
field |
index |
field |
| 1 |
Files |
2 |
Lines of Library |
3 |
Lines of Definitions |
| 4 |
Lines of TypeScript |
5 |
Lines of JavaScript |
6 |
Lines of JSON |
| 7 |
Lines of Other |
8 |
Nodes of Library |
9 |
Nodes of Definitions |
| 10 |
Nodes of TypeScript |
11 |
Nodes of JavaScript |
12 |
Nodes of JSON |
| 13 |
Nodes of Other |
14 |
Identifiers |
15 |
Symbols |
| 16 |
Types |
17 |
Instantiations |
18 |
Memory used |
| 19 |
Assignability cache size |
20 |
Identity cache size |
21 |
Subtype cache size |
| 22 |
Strict subtype cache size |
23 |
I/O Read time |
24 |
Parse time |
| 25 |
ResolveModule time |
26 |
ResolveTypeReference time |
27 |
Program time |
| 28 |
Bind time |
29 |
Check time |
30 |
printTime time |
| 31 |
Emit time |
32 |
Total time |