rescript-lang / rescript-lang/rescript-vscode

Design: reduce latency by saving initial state

Aperta
#280 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement
Lingua principale
ReScript
Stelle
354
Fork
63
Merge medio
11h 29m
PR unite (30g)
1

Descrizione

Every time any editor command is invoked, the analysis starts from scratch. Find and read bsconfig.json, scan project files, etc.
Then executing the actual command is typically little work (exception: command to find all the references).
See for example:
https://github.com/rescript-lang/rescript-vscode/blob/master/analysis/tests/src/expected/Debug.res.txt

There's an opportunity for reducing latency by caching the initial state of the project before executing the specific command.

However, even though technically this is a clear opportunity for speedup, latency has in practice not been an issue in existing projects. So this note is just about some design ideas, but there's no action plan at the moment, as there is no need.

Anyhow, one could save the state after project initialisation, in a special marshalled file. And if that file exists, one can quickly read that marshalled file. Care is required to consider all the inputs to that file (for example, if bsconfig.json or any other input changes). Plus, one needs to check that if a .cmt on disk has changed (probably via timestamp), that the new version is loaded. Such a mechanism was there until recently, so it's about checking that it still works.
Finally, there's the question of when to update the file with the marshalled state on disk.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia leggendo l’esempio in analysis/tests/src/expected/Debug.res.txt e esaminando la descrizione dell’issue sull’inizializzazione del progetto e il precedente meccanismo di marshalled state. Determina gli input e le condizioni di aggiornamento che dovrebbero essere coperti; l’issue non definisce un piano di implementazione né una condizione chiara per considerare il lavoro completato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Ambito
devtools, performance
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
20/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.