Improve performance of InternalParquetRecordReader (1%)
- Langage dominant
- Java
- Étoiles
- 3.1k
- Forks
- 1.6k
- Merge moyen
- 3 j 12 h
- PR mergées (30 j)
- 33
Description
### Describe the enhancement requested
Profiling the load of a Parquet file with Java Mission Control, I've noticed that `InternalParquetRecordReader` [LongStream](https://github.com/apache/parquet-java/blob/1f1e07bbf750fba228851c2d63470c3da5726831/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/InternalParquetRecordReader.java#L323) consumes relevant amount of time.
This `LongStream` can be replaced with a simpler Long Iterator that iterates from 0 to `pages.getRowCount()`.
To measure the overhead I've created a test project that overwrites `InternalParquetRecordReader` implementation with a Long Iterator: https://github.com/jerolba/parquet-rowindexiterator
The execution time is sensitive to the context of the JVM, but running the benchmark multiple times shows that LongStream is slower than LongIterator, between 1% and 4% depending on the run.
### Component(s)
_No response_
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez dans parquet-hadoop/src/main/java/org/apache/parquet/hadoop/InternalParquetRecordReader.java, au niveau du LongStream vers la ligne 323, puis examinez le projet de benchmark parquet-rowindexiterator indiqué. Comparez l’itération actuelle du reader avec l’approche Long Iterator du benchmark ; le travail est terminé lorsque le reader évite la surcharge LongStream signalée tout en préservant le comportement d’itération par index de ligne.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- data-engineering, performance
- Type d'issue
- Fonctionnalité
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 55/100