microsoft / microsoft/TypeScript
Keep TSServer alive longer for initialization performance
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
Hello! First off, thank you for your work on VSCode -- by far my favorite and the most popular editor at my company.
I work in a very large monorepo, with 5M lines of TS, across ~70k TS files, across ~900 projects (here is a small scale reproduction of our setup: https://github.com/brieb/ts-monorepo/).
While working in a monorepo, its common to jump between files in different projects. Each time a file is opened for a new project, the TS server needs to be initialized ("Initializing JS/TS language features"). For some of our largest projects, this can take up to a minute. But if that file is closed during the course of the editing session, the corresponding TS/JS server is shutdown, and you'd have to wait another minute when coming back to a file in that project.
Some people have hacked around this by deliberately keeping tabs open for files in each of the projects they are working in even when they are done with the file (but not the project) to keep the TS server alive and avoid paying that startup cost.
Curious if you've run into or thought about this problem before and have ideas for improving this workflow
One idea could be making the shutdown behavior configurable -- immediate (today's behavior), timeout-based (after a certain timeout with no project activity the server is shutdown).
Hopefully this feature could benefit others that work in a similar monorepo environment too.
keywords: tsserver, persist, persistence, keep alive, initialize, initializing, monorepo
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con la riproduzione collegata di ts-monorepo e analizza in che modo tsserver arresta i progetti dopo la chiusura dei relativi file. Definisci un comportamento concreto di keep-alive configurabile o basato su un timeout, quindi verifica che riaprire file nello stesso progetto eviti ritardi di inizializzazione ripetuti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- developer-experience, performance, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100