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

Ouverte
#1,238 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
45/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Calme
Stack technique
java
Domaine
performance

Piste de recherche

Commencez par PromotableWriter.setPosition(int) et le chemin d’appel de AbstractFieldWriter décrit dans l’issue. Reproduisez le comportement de dispatch à l’aide du benchmark JMH dans le module performance, puis vérifiez que la modification obtenue améliore le dispatch mesuré sans régressions.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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
Langage dominant
Java
Étoiles
95
Forks
154
Merge moyen
2 j 16 h
PR mergées (30 j)
9

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de apache/arrow-java

Toutes les issues de apache/arrow-java

Issues similaires

Plus d'issues Java

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.