[
https://issues.apache.org/jira/browse/CASSANDRA-21402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18083345#comment-18083345
]
Dmitry Konstantinov commented on CASSANDRA-21402:
-------------------------------------------------
[^CASSANDRA-21402_before_cpu.html]
[^CASSANDRA-21402_after_cpu.html]
we can see that after the change there is no anymore HashMap.get when we read a
column value:
!after.png|width=1000!
vs as it was before:
!before.png|width=1000!
stress test results:
Before:
{code}
Results:
Op rate : 146,764 op/s [partition-select: 146,764 op/s]
Partition rate : 146,000 pk/s [partition-select: 146,000 pk/s]
Row rate : 1,460,001 row/s [partition-select: 1,460,001 row/s]
Latency mean : 2.0 ms [partition-select: 2.0 ms]
Latency median : 1.5 ms [partition-select: 1.5 ms]
Latency 95th percentile : 3.7 ms [partition-select: 3.7 ms]
Latency 99th percentile : 14.6 ms [partition-select: 14.6 ms]
Latency 99.9th percentile : 26.7 ms [partition-select: 26.7 ms]
Latency max : 355.5 ms [partition-select: 355.5 ms]
Total partitions : 14,921,898 [partition-select: 14,921,898]
Total errors : 0 [partition-select: 0]
Total GC count : 21
Total GC memory : 368.216 GiB
Total GC time : 0.3 seconds
Avg GC time : 12.6 ms
StdDev GC time : 3.9 ms
Total operation time : 00:01:42
{code}
After:
{code}
Results:
Op rate : 149,468 op/s [partition-select: 149,468 op/s]
Partition rate : 148,684 pk/s [partition-select: 148,684 pk/s]
Row rate : 1,486,841 row/s [partition-select: 1,486,841 row/s]
Latency mean : 2.0 ms [partition-select: 2.0 ms]
Latency median : 1.5 ms [partition-select: 1.5 ms]
Latency 95th percentile : 3.6 ms [partition-select: 3.6 ms]
Latency 99th percentile : 14.5 ms [partition-select: 14.5 ms]
Latency 99.9th percentile : 25.6 ms [partition-select: 25.6 ms]
Latency max : 116.1 ms [partition-select: 116.1 ms]
Total partitions : 14,921,329 [partition-select: 14,921,329]
Total errors : 0 [partition-select: 0]
Total GC count : 21
Total GC memory : 387.120 GiB
Total GC time : 0.3 seconds
Avg GC time : 12.4 ms
StdDev GC time : 0.7 ms
Total operation time : 00:01:40
{code}
> Avoid type lookup in SerializationHeader#getType if schema and SSTable are
> aligned
> ----------------------------------------------------------------------------------
>
> Key: CASSANDRA-21402
> URL: https://issues.apache.org/jira/browse/CASSANDRA-21402
> Project: Apache Cassandra
> Issue Type: Improvement
> Components: Local/SSTable
> Reporter: Dmitry Konstantinov
> Assignee: Dmitry Konstantinov
> Priority: Normal
> Fix For: 6.x, 7.x
>
> Attachments: CASSANDRA-21402_after_cpu.html,
> CASSANDRA-21402_before_cpu.html, after.png, before.png,
> image-2026-05-24-16-36-12-733.png
>
>
> Cell.Serializer#deserialize lookup an actual type for every cell using
> SerializationHeader#getType, it is ~27% of a cell deserialization CPU cost
> and ~5% of total CPU cost for a read scenario (10 row partition select, CPU
> bound)
> if schema and SSTable are aligned we can avoid this lookup (we can go further
> and avoid it even if they are not aligned but it looks more complicated from
> analysis or/and implementation point of view)
> !image-2026-05-24-16-36-12-733.png|width=800!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]