Skip to content

Conversation

@netudima
Copy link
Contributor

Reduce memory allocation during transformation of BatchStatement to Mutation

Patch by Dmitry Konstantinov; reviewed by TBD or CASSANDRA-21141

@netudima netudima force-pushed the CASSANDRA-21141-trunk branch from cfb38de to 7889c51 Compare February 5, 2026 16:17
…utation

avoid ClusteringIndexSliceFilter allocation if a write does not required a read (plain usual write), avoid iterator allocation, use array instead of ArrayList for perStatementOptions which does not grow dynamically
BatchStatement: check if many similar rows for the same table are written unconditionally, in this case we can avoid columns info merging and builders allocation
add fast path in nonTokenRestrictionValues logic, when we specify a single partition key (a single row) to modify, optimize also the case if a partition or clustering key is a single column
add fast path in valuesAsClustering logic, when we specify a single clustering key (a single row) to modify
UpdateParameters: allocate DeletionTime on demand (it is not needed if we do insert/updates)
serializedRowBodySize: avoid capturing lamda allocation per cell by moving capturing arguments to SerializationHelper (same optimization as it was done in serializeRowBody)
force hash3_x64_128 inlining to help JIT with escape analysis and long[] heap allocation elimination

patch by Dmitry Konstantinov; reviewed by Chris Lohfink for CASSANDRA-21141
@netudima netudima force-pushed the CASSANDRA-21141-trunk branch from 7889c51 to d1b1934 Compare February 5, 2026 18:45
@netudima netudima closed this Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants