microsoft / microsoft/TypeScript

Keep TSServer alive longer for initialization performance

Abierto
#39,844 0 comentarios 3 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Domain: LS: TSServer In Discussion Suggestion
Lenguaje dominante
Go
Estrellas
111k
Forks
14.4k
Merge medio
1 d 19 h
PR fusionados (30 d)
117

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con la reproducción enlazada de ts-monorepo e investiga cómo tsserver cierra los proyectos después de que se cierran sus archivos. Define un comportamiento concreto de keep-alive configurable o basado en un tiempo de espera y verifica después que volver a abrir archivos del mismo proyecto evita retrasos de inicialización repetidos.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
typescript
Área
developer-experience, performance, tooling
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.