Commit 99962e1
committed
apacheGH-3530: Optimize DICTIONARY encoding/decoding data structures and use ByteBuffer
Encoding improvements:
- Replace LinkedOpenHashMap with OpenHashMap + ArrayList for all
DictionaryValuesWriter subclasses, eliminating insertion-order
overhead and enabling O(1) indexed access for dictionary page
serialization and fallback
- Make IntList.size() O(1) by tracking totalSize incrementally
instead of summing across slab arrays
Decoding improvements:
- Convert PlainValuesDictionary numeric constructors (INT32, INT64,
FLOAT, DOUBLE) from InputStream-based per-byte reads to direct
ByteBuffer.getInt/getLong/getFloat/getDouble (JVM intrinsics)
Binary hashCode caching:
- Cache hashCode() for Binary instances that are not backed by reusable
byte arrays, avoiding redundant recomputation during dictionary
lookups (hash map probes)
JMH benchmarks:
- DictionaryEncodingBenchmark: scalar encoding for INT32, INT64, FLOAT,
DOUBLE, BINARY, and FIXED_LEN_BYTE_ARRAY with LOW/HIGH cardinality
and variable-length string/FLBA dimensions
- DictionaryDecodingBenchmark: scalar decoding for all types with
matching parameterization
- TestDataFactory: shared data generation utility for reproducible
benchmark inputs
- BenchmarkEncodingUtils: helper to drain DictionaryValuesWriter into
encoded dictionary page + data bytes for decoder setup1 parent 5922bf4 commit 99962e1
11 files changed
Lines changed: 1015 additions & 122 deletions
File tree
- parquet-benchmarks/src/main/java/org/apache/parquet/benchmarks
- parquet-column/src
- main/java/org/apache/parquet
- column/values/dictionary
- io/api
- test/java/org/apache/parquet
- column/values/dictionary
- io/api
Lines changed: 70 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
0 commit comments