apache / apache/parquet-java

Performance optimizations: Merged all LittleEndianDataInputStream functionality into ByteBufferInputStream

Offen
#2,674 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Component: Java Component: Parquet Priority: Major Type: enhancement
Vorherrschende Sprache
Java
Sterne
3.1k
Forks
1.6k
Ø Merge
3 T. 12 Std.
Gemergte PRs (30 T.)
33

Beschreibung

This PR is all performance optimization. In benchmarking with Trino, we find query performance to improve from 5% to 15%, depending on the query, and that includes all the I/O time from S3.

The main modification is to merge all of LittleEndianDataInputStream functionality into ByteBufferInputStream, which yields the following benefits:
- Elimination of extra layers of abstraction and method call overhead
- Enable the use of intrinsics for readInt, readLong, etc.
- Availability of faster access methods like readFully and skipFully, without the need for helper functions
- Reduces some object creation in the performance critical path

This also includes and enables performance optimizations to:
- ByteBitPackingValuesReader
- PlainValuesReader
- RunLengthBitPackingHybridDecoder

Context:
I've been working on improving Parquet reading performance in Trino, mostly by profiling while running performance benchmarks and TPCDS queries. This PR is a subset of the changes I made that have more than doubled the performance of a lot of TPCDS queries (wall clock time, including the S3 access time). If you are kind enough to accept these changes, I have more I would like to contribute.

**Reporter**: [Timothy Miller](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=theosib-amazon) / @theosib-amazon
#### Externally tracked issue: [https://github.com/apache/parquet-mr/pull/953](https://github.com/apache/parquet-mr/pull/953)

**Note**: *This issue was originally created as [PARQUET-2135](https://issues.apache.org/jira/browse/PARQUET-2135). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne mit der Überprüfung des extern nachverfolgten Pull Requests 953 und der genannten Komponenten: ByteBufferInputStream, LittleEndianDataInputStream, ByteBitPackingValuesReader, PlainValuesReader und RunLengthBitPackingHybridDecoder. Vergleiche die relevanten Trino- und TPCDS-Benchmark-Ergebnisse; als abgeschlossen gilt die Aufgabe, wenn die zusammengeführte Funktionalität und die Optimierungen ohne Regressionen validiert sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
data-engineering, performance
Issue-Typ
Refactoring
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

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