Skip to content

Instantly share code, notes, and snippets.

@MichaelDimmitt
Last active May 10, 2024 12:49
Show Gist options
  • Save MichaelDimmitt/e8a04a4a835ed6ac7447927a424e48c0 to your computer and use it in GitHub Desktop.
Save MichaelDimmitt/e8a04a4a835ed6ac7447927a424e48c0 to your computer and use it in GitHub Desktop.
typescript performance lsp experiments

Status: Test has not been completed.

Things to test, to learn how to speed up a typescript lsp.

If config file is at root of project:

  1. only open the folders that you will be working in for your editor.
    is it smart enough to know to only check that folder?
  2. does number of files open in the editor matter?
  3. does it matter if you have multiple config files? (one in each folder)

a. The test ... make a significantly annoying typescript project.
b. run the experiments.

Report findings here: https://news.ycombinator.com/item?id=25199070

https://github.com/microsoft/TypeScript-wiki/blob/main/Performance-Tracing.md

{ # how to find hotspots (low performant types in your codebase)
rm -rf tracing_output_folder; 
npx tsc -p tsconfig.json --generateTrace tracing_output_folder; 
npx @typescript/analyze-trace tracing_output_folder;
}

Related links:

  1. https://news.ycombinator.com/item?id=25199070
  2. https://www.reddit.com/r/typescript/comments/xzy20q/how_to_find_the_type_that_is_causing_performance/

This is an "infer from usage test"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment