Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 22360 invoked from network); 14 Jul 2008 18:00:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jul 2008 18:00:52 -0000 Received: (qmail 11384 invoked by uid 500); 14 Jul 2008 18:00:53 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 11284 invoked by uid 500); 14 Jul 2008 18:00:52 -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 11275 invoked by uid 99); 14 Jul 2008 18:00:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jul 2008 11:00:52 -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; Mon, 14 Jul 2008 18:00:08 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id CEFAD234C16B for ; Mon, 14 Jul 2008 11:00:31 -0700 (PDT) Message-ID: <31595146.1216058431846.JavaMail.jira@brutus> Date: Mon, 14 Jul 2008 11:00:31 -0700 (PDT) From: "Andrew Cornwall (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-5907) [classlib][pack200]CPUTF8.hashCode() is slow In-Reply-To: <2142909012.1215809191823.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-5907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613388#action_12613388 ] Andrew Cornwall commented on HARMONY-5907: ------------------------------------------ I would suggest at least one change: have the generateHashCode() method assign the cachedHashCode. Right now, users will have to write code like this: // I want to assign the hashCode cachedHashCode = generateHashCode(); It's possible (and in fact I did the following) when updating a class: // I want to assign the hashCode generateHashCode(); // at this point hashCodeComputed == true, but cachedHashCode is not yet assigned. > [classlib][pack200]CPUTF8.hashCode() is slow > -------------------------------------------- > > Key: HARMONY-5907 > URL: https://issues.apache.org/jira/browse/HARMONY-5907 > Project: Harmony > Issue Type: Improvement > Affects Versions: 5.0M6 > Environment: Latest pack200 > Reporter: Andrew Cornwall > Assignee: Sian January > Attachments: main.patch, pack200-hashcodes-v1.patch > > > The unpack process spends a lot of time doing CPUTF8.hashCode() - which does String.hashCode(). We can save about 1.5 seconds of my 39 second test case (about 4%) by caching the hashCode. (I thought we did this before - or maybe I dreamt it?) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.