You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Blake Eggleston (Jira)" <ji...@apache.org> on 2019/12/10 00:33:00 UTC
[jira] [Commented] (CASSANDRA-15394) Remove list iterators
[ https://issues.apache.org/jira/browse/CASSANDRA-15394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16992056#comment-16992056 ]
Blake Eggleston commented on CASSANDRA-15394:
---------------------------------------------
Good idea. Updated the branch. I just called it {{size}}. Probably the most obvious and easily understandable at a glance.
One issue I can see with this is that there is now the risk of accidentally updating the size value in the body of the loop, and using a more commonly used variable name increases this risk. Alternatively, {{final int size = list.size()}} could be declared right before the for loop, but that would escape the scope of the for loop, and make multiple for loops in the same method more awkward. All things considered though, I'd probably just go with {{size}} in the for loop init, or maybe {{isize}}. _</bikeshed>_
> Remove list iterators
> ---------------------
>
> Key: CASSANDRA-15394
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15394
> Project: Cassandra
> Issue Type: Sub-task
> Components: Local/Compaction
> Reporter: Blake Eggleston
> Assignee: Blake Eggleston
> Priority: Normal
> Fix For: 4.0
>
>
> We allocate list iterators in several places in hot paths. This converts them to get by index. This provides a ~4% improvement in relvant workloads.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org