Skip to content

Avoid megamorphic List.get in ClusteringPrefix.Deserializer - #5178

Closed
frankgh wants to merge 1 commit into
apache:trunkfrom
frankgh:CASSANDRA-21587-trunk
Closed

frankgh wants to merge 1 commit into
apache:trunkfrom
frankgh:CASSANDRA-21587-trunk

Conversation

@frankgh

@frankgh frankgh commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Carry clustering types as AbstractType<?>[] instead of List, so the hot path does an array load with no virtual dispatch and ClusteringComparator needs no defensive copy.

patch by Taejin Koo and Francisco Guerrero; reviewed by TBD for CASSANDRA-21587

Co-authored-by: koo.taejin koo.taejin@gmail.com

Comment thread src/java/org/apache/cassandra/io/util/DataOutputPlus.java Outdated
Comment thread test/bin/jmh
CLASSPATH="$CLASSPATH:$CASSANDRA_HOME/build/test/lib/jars/*"

exec $NUMACTL "$JAVA" -Xmx8g -XX:+UseParallelGC -cp "$CLASSPATH" org.openjdk.jmh.Main -jvmArgs="-Djmh.shutdownTimeout=120 $cassandra_parms $JVM_OPTS" "$@"
if [ -n "${JMH_CLASSPATH_PREFIX:-}" ] ; then

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was added to make running JMH with custom classpaths and with additional options for JMH, for example profiling with gc enabled

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can omit this file, but added it for reference . This was taking from @koo-taejin 's comment in JIRA

Comment thread test/unit/org/apache/cassandra/io/util/DataOutputTest.java Outdated
@frankgh
frankgh requested a review from netudima September 17, 2026 17:01
@frankgh

frankgh commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

@koo-taejin can you take a look at this patch?

Comment thread src/java/org/apache/cassandra/db/ClusteringComparator.java Outdated
Comment thread src/java/org/apache/cassandra/db/SerializationHeader.java
Comment thread test/unit/org/apache/cassandra/db/SerializationHeaderTest.java Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it looks like we still the file in the diff due to the last line change..

@netudima netudima left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@koo-taejin @frankgh - thank you!

Carry clustering types as AbstractType<?>[] instead of List, so the hot
path does an array load with no virtual dispatch and ClusteringComparator
needs no defensive copy.

 patch by Taejin Koo and Francisco Guerrero; reviewed by Taejin Koo, Dmitry Konstantinov for CASSANDRA-21587

Co-authored-by: koo.taejin <koo.taejin@gmail.com>
@frankgh
frankgh force-pushed the CASSANDRA-21587-trunk branch from 298e7ef to 89cb983 Compare September 20, 2026 23:42
@frankgh

frankgh commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

Closed via cc6eb8d

@frankgh frankgh closed this Sep 20, 2026
@frankgh
frankgh deleted the CASSANDRA-21587-trunk branch September 20, 2026 23:56
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.

3 participants