microsoft / typescript-analyze-trace

A tool for analyzing the output of `tsc --generateTrace`
MIT License
338 stars 19 forks source link

request: something like `--watch` mode #32

Open dylang opened 2 years ago

dylang commented 2 years ago

It would be helpful if there was something like --watch mode, or documentation for how to do this.

Example workflow:

  1. We run analyze-trace ts-trace
  2. Oh look, a hot spot!
    
    Analyzed /Users/dylang/project/packages/example/tsconfig.json (trace.65458-188.json)
    Hot Spots
    └─ Check file /Users/dylang/project/packages/example/slow-type-in-here.js (1739ms)
    └─ Check variable declaration from (line 57, char 7) to (line 62, char 2) (1441ms)
      └─ Check expression from (line 57, char 30) to (line 62, char 2) (1441ms)
         └─ Check expression from (line 57, char 30) to (line 57, char 52) (1438ms)
            └─ Compare types 13361 and 4729 (1249ms)

3. We make a change to try to fix it, and hit save....

_This is where this feature request starts._

4. `analyze-trace` automatically runs again. Fewer files may need to be recompiled so analyze-trace is only showing results from those re-compiles. **Feature Request** 
5. The output from `analyze-trace` tells us how much faster or slower each change is compared to the previous run. **Bonus Feature Request**