php / php/php-src

Ability to whitelist/blacklist functions from JIT

Offen
#20,458 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Feature Status: Needs Triage
Vorherrschende Sprache
C
Sterne
40.4k
Forks
8.1k
Ø Merge
2 T. 13 Std.
Gemergte PRs (30 T.)
96

Beschreibung

Description

I maintain a decent size, long-running application using PHP.

I've been very excited about the introduction of JIT into PHP before, since as a long-running, CPU-heavy application, it stands to benefit far more from JIT than the average PHP application.
However, our attempts to rollout JIT usage have been constantly thwarted by a plague of crashes and stability issues that have made it unusable for all practical purposes. This remains true as of PHP 8.4, although I will grant that the stability of the JIT does seem a lot better since the introduction of IR.

This issue is a request for some way to whitelist/blacklist code from being JITed.

For example, there is some math-heavy code in PocketMine that benefits from tracing JIT to the tune of a 5x performance improvement. It would be a probably acceptable tradeoff to enable JIT in just that one code pathway to get that huge performance improvement, since we can test that specific part of the code heavily in isolation, while avoiding it in other areas where stability is more important.

Conversely, it would make it much easier to track down JIT issues in large applications if there were some way to blacklist code from being compiled by the JIT, so that code can be A/B tested in parts in real-world conditions.

Perhaps this could take the form of #[AllowJIT] and/or #[DenyJIT] attributes on functions, but maybe there is a better way that I'm not aware of.

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

Das Issue nennt keine php-src-Dateien, Tests oder Einstiegspunkte; beginne damit, die JIT-Implementierung und ihre vorhandenen Konfigurations- oder Steuerungsmechanismen zu lokalisieren. Das angeforderte Verhalten ist ein Designvorschlag für das selektive Aktivieren oder Deaktivieren der JIT-Kompilierung, daher wären eine vereinbarte API und Abnahmetests erforderlich, bevor die Implementierung als abgeschlossen betrachtet werden kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c, php
Bereich
compilers, performance
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
20/100

Neue Issues direkt in Ihr Postfach

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