andygrove opened a new pull request, #3298: URL: https://github.com/apache/datafusion-comet/pull/3298
## Summary - Cache `Class.forName()` and `getMethod()` reflection calls in a `ReflectionCache` object - Created once per `convert()` call instead of repeatedly for each FileScanTask - Eliminates redundant reflection lookups in the hot path ## Benchmark Results (30,000 tasks) | Metric | Before | After | Improvement | |--------|--------|-------|-------------| | FileScanTask -> Protobuf (convert) | 34,425 ms | 26,088 ms | **24% faster** | The `ReflectionCache` holds all Iceberg classes and methods needed for serialization: - Iceberg classes: `ContentScanTask`, `FileScanTask`, `ContentFile`, `DeleteFile`, `SchemaParser`, `Schema`, `PartitionSpecParser`, `PartitionSpec` - Methods: `file()`, `start()`, `length()`, `partition()`, `residual()`, `schema()`, `deletes()`, `spec()`, `location()`, `content()`, `specId()`, `equalityFieldIds()`, `toJson()` ## Test plan - [x] Existing Iceberg tests pass - [x] Benchmarked with 30,000 partitions showing 24% improvement 🤖 Generated with [Claude Code](https://claude.ai/code) -- 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]
