You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: memoize cql_parameterized_type() on all type classes
Cache the computed CQL type string in a _cql_type_str class attribute.
The string is computed lazily on first call and returned from cache on
subsequent calls. Since type classes are immutable after
apply_parameters(), no invalidation logic is needed.
All 6 cql_parameterized_type() overrides are covered:
_CassandraType (base), TupleType, UserType, CompositeType,
DynamicCompositeType, VectorType.
Benchmark (500k iters, Python 3.14):
Int32Type (simple): 6.9x (157 -> 23 ns)
MapType<text, int>: 22.9x (464 -> 20 ns)
SetType<float>: 18.2x (371 -> 20 ns)
ListType<double>: 17.3x (357 -> 21 ns)
TupleType<int,text,bool>: 25.0x (509 -> 20 ns)
Nested map/list/tuple: 11.4x (636 -> 56 ns)
0 commit comments