Commit efbf0fb
committed
Cache packer in delta writers (resolves TODO)
Addresses the TODO at DeltaBinaryPackingValuesWriterForLong.java:119:
"should this cache the packer?". Adds a per-instance BytePacker[] /
BytePackerForLong[] cache keyed by bit width to avoid a factory
dispatch + array load on each miniblock flush. Symmetric to the reader
cache added in the previous commit (9c14a33).
Results on IntEncodingBenchmark.encodeDelta (5 iter x 1 fork):
SEQUENTIAL: 73.05M -> 73.67M (+0.8%, within noise)
RANDOM: 50.99M -> 51.51M (+1.0%, within noise)
LOW_CARDINALITY: 61.15M -> 61.37M (+0.4%, within noise)
HIGH_CARDINALITY: 51.30M -> 50.79M (-1.0%, within noise)
Kept as code-quality improvement: resolves the explicit TODO, mirrors
the reader structure, and the long writer has a 65-entry bit-width
space vs 33 for int (more factory dispatch cost avoided).
All 573 parquet-column tests pass (including 100K-round random delta
tests).1 parent e67c383 commit efbf0fb
2 files changed
Lines changed: 22 additions & 3 deletions
File tree
- parquet-column/src/main/java/org/apache/parquet/column/values/delta
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
119 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
120 | 130 | | |
121 | 131 | | |
122 | 132 | | |
| |||
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
119 | | - | |
120 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
121 | 130 | | |
122 | 131 | | |
123 | 132 | | |
| |||
0 commit comments