microsoft / microsoft/TypeScript

Use Profile-Guided Optimization (PGO) for the compiler itself

Offen
#63,774 5 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Domain: Performance Possible Improvement
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
132

Beschreibung

Hi!

Since the compiler is to be rewritten in Go, I suggest considering using the Profile-Guided Optimization (PGO) option to optimize the Typescript compiler itself. Go [supports](https://go.dev/doc/pgo) PGO since 1.20 so it's an available option for the project. PGO for compiler-like workloads works especially well - e.g. check my PGO [benchmarks](https://github.com/zamazan4ik/awesome-pgo?tab=readme-ov-file#compilers-and-interpreters) for compilers (even if most of are for non-Go projects, the results should be pretty the same for Go since it uses the same ideas).

I suggest you the following plan:

* Perform PGO benchmarks for the compiler. It will require thinking about the training workload - I think compiling any Typescript project would be a good option for most of the use-cases
* Providing some scripts for simplifying building the compiler with PGO
* Integrating PGO optimization step into the CI pipeline so end-users will get a PGO-optimized version of the compiler.

I understand that the project is in its early-stages and probably there are more important things to finish at the moment. If this is true, just consider the issue as a point of improvement for the future versions. I believe that improving the compiler performance is a valuable-enough things for the end-users.

Thank you.

P.S. If you think that Discussions is a better place for such issues - feel free to move it there.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Durchsicht der PGO-Dokumentation für Go 1.20 und der aktuellen Build- und CI-Einstiegspunkte des Compilers. Erstelle einen repräsentativen TypeScript-Trainings-Workload, vergleiche PGO mit der Baseline und beurteile, ob die CI-Integration einen messbaren Nutzen bringt. Im Issue werden keine bestimmten Dateien oder Tests genannt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
go, typescript
Bereich
ci-cd, compilers, performance
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.