Repository navigation
Conversation
There was a problem hiding this comment.
📋 Review Summary
This PR introduces well-targeted performance optimizations for Row.Builder, Row.FieldValueBuilder, and FieldAccessDescriptorParser by avoiding ANTLR parser overhead on simple identifiers and bypassing RowFieldMatcher / FieldAccessDescriptor tree allocations for flat field captures and overrides. The implementation preserves existing semantics and includes solid unit tests and JMH benchmarks.
🔍 General Feedback
- The fast paths in
FieldAccessDescriptorParser.isSimpleIdentifier,Row.FieldValueBuilder, andRowUtils.captureRowValuescleanly mirror the validation, type-casting, and nullability behavior ofRowFieldMatcherandCapturingRowCaseswhile avoiding intermediate object allocations. - Consider also resolving
FieldAccessDescriptorkeys inFieldValueBuilder.withFieldAccessDescriptors(if not already resolved) or keeping in mind thataddOverrideexpects resolved descriptors with non-nullfieldIds.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
…access parsing - FieldAccessDescriptorParser: add fast-path check and parser for simple identifier field names without invoking ANTLR lexer/parser. - Row / RowUtils: add direct array-backed flat field overrides and direct value capture fast path avoiding RowFieldMatcher / FieldAccessDescriptor tree allocations when no nested overrides are present; lazily size Builder backing lists. - Add unit tests in RowTest and FieldAccessDescriptorParserTest, plus JMH benchmarks in RowBuilderBenchmark. missing files
4f85e77 to
cbd2ad1
Compare
|
R: @sjvanrossum @sjvanrossum I had a pr with improvements to Row creation, that I realized overlapped with your pr/40791. I merged those components of 40791 into this PR, if you don't mind. |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
|
Note: This doesn't affect BeamSQL or most of the schema aggregation transforms, as those transforms already avoid using the Row builder - instead using Row.withSchema().attachValues |
…FieldAccessDescriptorParser: add fast-path check and parser for simple identifier field names without invoking ANTLR lexer/parser.
Also merged in optimizations from #40791