microsoft / microsoft/TypeScript

Keep TSServer alive longer for initialization performance

オープン
#39,844 コメント 0 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Domain: LS: TSServer In Discussion Suggestion
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リンクされた ts-monorepo の再現手順から始め、ファイルを閉じた後に tsserver がプロジェクトをどのようにシャットダウンするかを調査します。設定可能またはタイムアウトベースの具体的な keep-alive 動作を定義し、その後、同じプロジェクトのファイルを再度開いたときに初期化の遅延が繰り返し発生しないことを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
developer-experience, performance, tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。