Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 84711 invoked from network); 3 Apr 2008 10:30:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Apr 2008 10:30:55 -0000 Received: (qmail 15226 invoked by uid 500); 3 Apr 2008 10:30:55 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 15131 invoked by uid 500); 3 Apr 2008 10:30:55 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 15122 invoked by uid 99); 3 Apr 2008 10:30:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Apr 2008 03:30:55 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED 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; Thu, 03 Apr 2008 10:30:22 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 770D9234C0B9 for ; Thu, 3 Apr 2008 03:28:25 -0700 (PDT) Message-ID: <516183497.1207218505486.JavaMail.jira@brutus> Date: Thu, 3 Apr 2008 03:28:25 -0700 (PDT) From: "Sian January (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-5682) [classlib][pack200] Sped up hashCode and removed dead getCpAll() In-Reply-To: <2117977942.1207155447861.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-5682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sian January updated HARMONY-5682: ---------------------------------- Attachment: pack200.patch How does my modified patch work out for performance? (pack200.patch) > [classlib][pack200] Sped up hashCode and removed dead getCpAll() > ---------------------------------------------------------------- > > Key: HARMONY-5682 > URL: https://issues.apache.org/jira/browse/HARMONY-5682 > Project: Harmony > Issue Type: Improvement > Components: Classlib > Environment: All Pack200 > Reporter: Andrew Cornwall > Assignee: Sian January > Attachments: main.patch, pack200.patch > > > This patch does two things, one of which may be controversial. > The uncontroversial code removes SegmentConstantPool.getCpAll(), since it is no longer used. > The other code changes hashCode in CPUTF8, CPClass and CPRef. Because hashCode is used frequently, making it fast is a good idea. In the pack200 code as it exists, hashCode is never called for CPUTF8, CPClass or CPRef unless all instance variables have been set. The changes to hashCode make the assumption that this will always hold. As a consequence, hashCode will throw a NullPointerException when sent to uninitialized instances of these classes. > The changes to hashCode do improve runtime by about 10%. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.