[
https://issues.apache.org/jira/browse/CASSANDRA-21589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18107531#comment-18107531
]
Dmitry Konstantinov edited comment on CASSANDRA-21589 at 8/24/26 6:09 PM:
--------------------------------------------------------------------------
I've applied all ideas.
For the reducing of ClientState.isSuper invocation cost I've got the following
JMH results (authenticatedUserIsSuper - non-cached vs clientStateIsSuper -
cached):
{code:java}
Benchmark (grantedRoles) Mode Cnt
Score Error Units
ClientStateIsSuperBench.authenticatedUserIsSuper 1 avgt 10
220.110 ± 24.073 ns/op
ClientStateIsSuperBench.authenticatedUserIsSuper 8 avgt 10
241.169 ± 3.756 ns/op
ClientStateIsSuperBench.clientStateIsSuper 1 avgt 10
5.234 ± 0.245 ns/op
ClientStateIsSuperBench.clientStateIsSuper 8 avgt 10
5.400 ± 0.053 ns/op
{code}
Run was JDK 21.0.10, 4 threads
was (Author: dnk):
I've applied all ideas.
For the reducing on cost ClientState.isSuper invocation I've got the following
JMH results (authenticatedUserIsSuper - non-cached vs clientStateIsSuper -
cached):
{code:java}
Benchmark (grantedRoles) Mode Cnt
Score Error Units
ClientStateIsSuperBench.authenticatedUserIsSuper 1 avgt 10
220.110 ± 24.073 ns/op
ClientStateIsSuperBench.authenticatedUserIsSuper 8 avgt 10
241.169 ± 3.756 ns/op
ClientStateIsSuperBench.clientStateIsSuper 1 avgt 10
5.234 ± 0.245 ns/op
ClientStateIsSuperBench.clientStateIsSuper 8 avgt 10
5.400 ± 0.053 ns/op
{code}
Run was JDK 21.0.10, 4 threads
> isOrdinaryUser check performed by Guardrail.enabled is expensive
> ----------------------------------------------------------------
>
> Key: CASSANDRA-21589
> URL: https://issues.apache.org/jira/browse/CASSANDRA-21589
> Project: Apache Cassandra
> Issue Type: Improvement
> Components: Feature/Guardrails
> Reporter: Dmitry Konstantinov
> Assignee: Dmitry Konstantinov
> Priority: Normal
> Fix For: 6.x, 7.x
>
> Attachments: cpu-heatmap_write.html, image-2026-08-20-16-05-55-487.png
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> We can get like 18% of CPU overhead for this check for a write load if
> authorization is enabled
> [^cpu-heatmap_write.html]
> write test:
> https://issues.apache.org/jira/browse/CASSANDRA-18831?focusedCommentId=18056293&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-18056293
> Guardrails:
> org.apache.cassandra.cql3.RowUpdateBuilder#validateCell -
> columnValueSize/columnTextAndVarcharValueSize
> org.apache.cassandra.cql3.statements.ModificationStatement#validateDiskUsage
> !image-2026-08-20-16-05-55-487.png|width=600!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]