Return-Path: Delivered-To: apmail-incubator-cassandra-commits-archive@minotaur.apache.org Received: (qmail 37689 invoked from network); 9 Dec 2009 18:28:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Dec 2009 18:28:40 -0000 Received: (qmail 48049 invoked by uid 500); 9 Dec 2009 18:28:40 -0000 Delivered-To: apmail-incubator-cassandra-commits-archive@incubator.apache.org Received: (qmail 48033 invoked by uid 500); 9 Dec 2009 18:28:40 -0000 Mailing-List: contact cassandra-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-dev@incubator.apache.org Delivered-To: mailing list cassandra-commits@incubator.apache.org Received: (qmail 48022 invoked by uid 99); 9 Dec 2009 18:28:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2009 18:28:40 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2009 18:28:38 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 980FB234C4BC for ; Wed, 9 Dec 2009 10:28:18 -0800 (PST) Message-ID: <778890408.1260383298621.JavaMail.jira@brutus> Date: Wed, 9 Dec 2009 18:28:18 +0000 (UTC) From: "Stu Hood (JIRA)" To: cassandra-commits@incubator.apache.org Subject: [jira] Commented: (CASSANDRA-611) Fix Findbugs: Replace keySet w entrySet In-Reply-To: <97025595.1260294438075.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12788212#action_12788212 ] Stu Hood commented on CASSANDRA-611: ------------------------------------ I just noticed that this report missed the most critical of all our abuses of keySet(): calling ColumnFamily.getSortedValues(), and then calling getColumn(name) on another CF. For two sorted lists, we should iterate in parallel. > Fix Findbugs: Replace keySet w entrySet > --------------------------------------- > > Key: CASSANDRA-611 > URL: https://issues.apache.org/jira/browse/CASSANDRA-611 > Project: Cassandra > Issue Type: Bug > Reporter: Stu Hood > Attachments: findbugs-keyset-w-entryset.txt > > > A lot of places in the codebase, we iterate over the keySet() of a Map, and call get() for each key. For a HashMap, this is still O(N), but when you are dealing with a SortedMap, this is O(NlogN). The list of occurences are attached. > Fixing this issue should give us a general (minor?) performance boost. > In order to find unused method parameters for CASSANDRA-608, I ran FindBugs against Cassandra, and found a few interesting issues we ought to explore (but not the unused method params, oi.) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.