Improve performance of InternalParquetRecordReader (1%)
- Lingua principale
- Java
- Stelle
- 3.1k
- Fork
- 1.6k
- Merge medio
- 3g 12h
- PR unite (30g)
- 33
Descrizione
### 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_
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia in parquet-hadoop/src/main/java/org/apache/parquet/hadoop/InternalParquetRecordReader.java, nel LongStream intorno alla riga 323, quindi esamina il progetto di benchmark parquet-rowindexiterator collegato. Confronta l’iterazione corrente del reader con l’approccio Long Iterator del benchmark; il lavoro è completato quando il reader evita l’overhead di LongStream segnalato preservando il comportamento dell’iterazione per indice di riga.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- data-engineering, performance
- Tipo di issue
- Funzionalità
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 55/100