microsoft / microsoft/TypeScript
Keep TSServer alive longer for initialization performance
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der verknüpften ts-monorepo-Reproduktion und untersuche, wie tsserver Projekte herunterfährt, nachdem ihre Dateien geschlossen wurden. Definiere ein konkretes konfigurierbares oder zeitüberschreitungsbasiertes Keep-Alive-Verhalten und überprüfe anschließend, dass das erneute Öffnen von Dateien im selben Projekt wiederholte Initialisierungsverzögerungen vermeidet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- developer-experience, performance, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100