mykaul opened a new pull request, #1951: URL: https://github.com/apache/cassandra-gocql-driver/pull/1951
## Summary - Replace the generic `Unmarshal` path in `unmarshalTabletHint` with a zero-reflection binary parser that reads the CQL wire format directly - The `tablets-routing-v1` custom payload is parsed inline in `executeQuery` on every response that carries tablet routing info — this is on the data path, not just a control path - Old path: constructs `TupleTypeInfo`/`CollectionType` structs, recurses through `Unmarshal` → `unmarshalTuple` → `unmarshalList`, boxes values into `[]any` slices, then `Build()` type-asserts them back out - New path: reads fixed-width big-endian fields directly from the byte slice with bounds checking; single allocation (replicas slice) ## Benchmark (RF=3) | Parser | ns/op | B/op | allocs/op | |---|---|---|---| | Reflect (old) | 1,189 | 1,032 | 34 | | Direct (new) | 52 | 80 | 1 | | **Improvement** | **22x faster** | **13x less memory** | **34x fewer allocs** | ## Changes - `conn.go`: New `parseTabletHintDirect()` function; `unmarshalTabletHint` delegates to it - `tablets/tablets.go`: Add `NewReplicaInfo()` and `NewTabletInfoDirect()` constructors to support direct construction without the builder's type-assertion logic - `conn_bench_test.go`: Benchmark + correctness test comparing both parsers ## Testing - All unit tests pass with `-race -tags unit` - Correctness test verifies both parsers produce identical output for the same payload -- 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]

