xiangfu0 opened a new pull request, #19533: URL: https://github.com/apache/pinot/pull/19533
DataTable result construction currently allocates a new byte array and ByteBuffer for every row. Reuse one lazily allocated fixed-row buffer per builder, clearing it between rows so omitted fields keep their original zero representation. This reduces Java allocation during selection and GROUP BY result serialization while preserving V4 wire bytes. Added a regression for populated, partially written and explicit-null rows (including variable-length offsets, NaN payloads and signed zero), plus a deterministic JMH benchmark and raw paired results under `pinot-perf/benchmark-results/datatable-row-buffer-20260912`. | 5,000-row operation | Median paired speedup | Allocation reduction | | --- | ---: | ---: | | Numeric construction | 1.33× | 56.9% | | Mixed construction | 1.13× | 37.7% | | Numeric construction + serialization | 1.29× | 38.6% | | Mixed construction + serialization | 1.10× | 23.7% | Three alternating baseline/candidate pairs on JDK 25, ARM64 macOS, one thread and a 512 MiB heap. The runtimes differ only in the freshly compiled builder class; the report documents the class-overlay control and includes all raw JMH results. Single-row allocation is unchanged; mixed single-row construction has a 0.976× median paired ratio (roughly 2.4% slower). These are shared-workstation component measurements, not end-to-end query throughput claims. Reproduction commands are in `pinot-perf/README.md`. Validation: 59 focused tests passed (`DataTableSerDeTest`, `SelectionOperatorServiceTest`, `InterSegmentGroupBySingleValueQueriesTest`); eight deterministic V4 outputs matched baseline wire hashes. Spotless, Checkstyle and both license goals passed. Independent correctness and performance/testing reviews found no actionable issues. Additional full-reactor `-Xlint:all` compilation stopped in unchanged `ZstandardDecompressor` on a missing `org.jetbrains.annotations.NotNull` class. Normal compilation/tests pass. Scoped lint of the changed sources passes with no warnings on added implementation/test lines; it excludes the repository-standard ASF header's dangling-doc warning and retains two existing raw Map warnings. No dependency workaround is included in this performance PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
