python / python/cpython

Compiling executors can result in excessively large amounts of machine code.

Offen
#141,794 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

interpreter-core performance topic-JIT type-feature
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
35.9k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

With the tracing front-end to the JIT we are producing longer traces than before.
This should be good, but results in very large chunks of machine code.
Large chunks of machine code are bad because:

  • It takes longer and uses more memory
  • It puts a lot of pressure on the icache, possibly evicting the interpreter
  • It makes handling of inline data and branches less efficient as the targets are further away.

To be clear, the problem is not the number of uops per trace, but the amount of machine code per uop.

Things we can do to fix this:

  • Move code into helper functions for the larger uops
  • Move complex decref sequences for DECREF_INPUTS() into helper functions.

(We can also do more optimizations to remove more uops, but that's a separate issue and we're doing it anyway)

Linked PRs
  • gh-142228
  • gh-142263
  • gh-142257
  • gh-142386
  • gh-142409

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

Es werden keine Quelldateien, Tests oder Einstiegspunkte genannt. Beginne mit der Prüfung der verknüpften PRs gh-142228, gh-142263, gh-142257, gh-142386 und gh-142409, um zu sehen, welche Teile der kompilierten Executoren und von DECREF_INPUTS() sie abdecken. Erledigt ist die Aufgabe, wenn die Größe des Maschinencodes reduziert wurde, ohne das Verhalten des Executors zu ändern, und die relevanten Tests oder Benchmarks erfolgreich durchlaufen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
compilers, performance
Issue-Typ
Bug
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
20/100

Neue Issues direkt in Ihr Postfach

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