getappmap / getappmap/appmap-java
Reduce allocations required to enter a hook
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 88
- Forks
- 17
- Ø Merge
- 2 T. 2 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
When a method is called, an "event template" is cloned and passed into the hook to be mutated. The template serves as cache for all the static properties (src path, defined class, method id, etc). It prevents us from needing to perform costly run-time reflection in nearly all cases.
This means we're cloning a new event from and event template for every hook called. We can drop these allocations by implementing a custom serializer that writes properties directly from the event template.
Not in scope for this issue, but worth keeping top of mind, is that we can cut Event allocations almost entirely by reusing events. We only need enough events to fill the buffer in the file stream. Once they're written, we can place them back in the pool to be picked up by another thread.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den Hook-Pfad zu finden, der eine Event-Vorlage klont, sowie den Serializer, der Events schreibt. Verfolge, wie statische Eigenschaften von der Vorlage in jedes geklonte Event übertragen werden. Als abgeschlossen gilt die Arbeit, wenn der benutzerdefinierte Serializer diese Eigenschaften direkt aus der Vorlage schreibt und die Clone-Allokationen pro Hook vermeidet; das Issue nennt keine bestimmte Datei und keinen auszuführenden Test.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- performance
- Issue-Typ
- Refactoring
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100