Skip to content

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yoruichi

A terminal profiler for TypeScript type-checking. It reads trace.json from tsc --generateTrace and shows expensive files and source lines.

screen

Install

With Nix:

nix profile install .

With Cargo:

cargo install --path .

You can also run it directly from this repository:

nix run . -- /tmp/trace

Generate a trace

For a regular TypeScript project:

tsc -p tsconfig.json --generateTrace /tmp/trace

For a project-reference monorepo:

tsc -b --force --generateTrace /tmp/trace

Build mode follows project references. --force ensures incremental build metadata does not skip projects.

Effect example

git clone https://github.com/Effect-TS/effect.git
cd effect
pnpm install
pnpm exec tsc -b --force --generateTrace /tmp/effect-trace
yoruichi /tmp/effect-trace tui

Commands

yoruichi /tmp/trace                         # hottest files
yoruichi /tmp/trace top --min-ms 1 --limit 20
yoruichi /tmp/trace list src/db.ts          # hot lines in one file
yoruichi /tmp/trace tui                     # interactive browser
yoruichi /tmp/trace folded                  # flamegraph input

Only trace.json is required. To use a differently named file:

yoruichi --trace-file path/to/trace.json

Hot-line times are compiler time, not application runtime. Nested trace events are counted once, and attributed line time may be lower than total file time.

TUI controls

  • /, j/k: navigate
  • PgUp/PgDn: move one page
  • Enter/: expand or annotate
  • /Esc: go back
  • a: annotate the selected file
  • o: open in $EDITOR
  • q: quit

About

A profiler for TypeScript type-checking.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages