You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Matt Byrd (Jira)" <ji...@apache.org> on 2026/04/21 09:55:00 UTC
[jira] [Commented] (CASSANDRA-21199) ProtocolVersion::supportedVersions can be computed once to avoid showing up in allocation profiles
[ https://issues.apache.org/jira/browse/CASSANDRA-21199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18075103#comment-18075103 ]
Matt Byrd commented on CASSANDRA-21199:
---------------------------------------
Could maybe patch together a few different allocation improvements.
It seems like also
Guardrails.readConsistencyLevels.guard(EnumSet.of(cl), state.getClientState());
allocates on the read path un-necessarily, we seem to have already fixed that on the write path e.g here:
https://github.com/apache/cassandra/commit/eed4fbc8f7789424d670c42a60f12150c48cd492#diff-d007b9924035feecdd6873339e3d084d6ca5866a47abe23a73925b87ea5fcbe7R144-R423
> ProtocolVersion::supportedVersions can be computed once to avoid showing up in allocation profiles
> --------------------------------------------------------------------------------------------------
>
> Key: CASSANDRA-21199
> URL: https://issues.apache.org/jira/browse/CASSANDRA-21199
> Project: Apache Cassandra
> Issue Type: Improvement
> Reporter: Matt Byrd
> Assignee: Matt Byrd
> Priority: Normal
> Attachments: Screenshot 2026-03-04 at 7.01.51 PM.png
>
>
> It's a relatively small amount in one allocation profile (see attached screenshot) ~0.3% of allocations, but still seems un-necessary as we're copying elements from a static final EnumSet
> {code}
> /** All supported versions, published as an enumset */
> public final static EnumSet<ProtocolVersion> SUPPORTED = EnumSet.copyOf(Arrays.asList(ArrayUtils.addAll(SUPPORTED_VERSIONS)));
> {code}
> Could instead just compute this in static initialization .
> {code}
> public static List<String> supportedVersions()
> {
> List<String> ret = new ArrayList<>(SUPPORTED.size());
> for (ProtocolVersion version : SUPPORTED)
> ret.add(version.toString());
> return ret;
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org