[java][Vector][Performance] PromotableWriter.setPosition resolving to itable dispatch on C2 compiled path.

Offen
#1,238 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
java
Bereich
performance

Rechercherichtung

Beginne mit PromotableWriter.setPosition(int) und dem im Issue beschriebenen Aufrufpfad von AbstractFieldWriter. Reproduziere das Dispatch-Verhalten mithilfe des JMH-Benchmarks im performance-Modul und überprüfe anschließend, dass die resultierende Änderung die gemessene Dispatch-Leistung verbessert, ohne Regressionen zu verursachen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Type: enhancement
Describe the enhancement requested

This is my first issue report here. Thanks for all the wonderful work.

Usecase: I am planning to replace our parquet-mr based parquet writer with arrow-java to arrow-rs via SharedMemory IPC. Each Kubernetes pod writes about 3 to 4 thousand event per second per pod. The original schema does have some heavy nesting (thrift influence) and schema redesign while desirable but is a much longer exercise. In the process of proof of concept, was able to get the whole flow working but when running some sample shadow flows, saw that all dispatch via

PromotableWriter.setPosition(int index)

would result in a itable dispatch. Looking at it, there could be multiple implementations of FieldWriter's at callsite and C2 fails to convert it into monomorphic or bimorphic calls. Was able to get a synthetic benchmark setup inside the performance module and can see the same in JMH runs too.

Image

This wonderful writeup by Aleksey Shipilev speaks about it in great detail.
We can convert the itable dispatch to a vtable dispatch by the method to be dispatched over AbstractFieldWriter. I will do more tests around the same and can submit the PR here. Tried searching over the issues and this doesn't seem to have been reported so far. Just curious if I am doing something wrong when using ListVector's (and hence holding back attaching the PR straight away!).

Just pasting the screen grab of the actual struct writer used in the benchmark. The benchmark is produced by claude (as one can make it out looking at the comments, but it seemed pretty ok to me).

Image
Vorherrschende Sprache
Java
Sterne
95
Forks
154
Ø Merge
2 T. 16 Std.
Gemergte PRs (30 T.)
9

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus apache/arrow-java

Alle Issues in apache/arrow-java

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

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