Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 52910 invoked from network); 16 May 2008 08:59:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 May 2008 08:59:20 -0000 Received: (qmail 8094 invoked by uid 500); 16 May 2008 08:59:21 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 7883 invoked by uid 500); 16 May 2008 08:59:20 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 7872 invoked by uid 99); 16 May 2008 08:59:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 May 2008 01:59:20 -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; Fri, 16 May 2008 08:58:34 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C4132234C117 for ; Fri, 16 May 2008 01:58:55 -0700 (PDT) Message-ID: <793886844.1210928335801.JavaMail.jira@brutus> Date: Fri, 16 May 2008 01:58:55 -0700 (PDT) From: "Jukka Zitting (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Commented: (JCR-1604) NameImpl improvements In-Reply-To: <153140389.1210864435794.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/JCR-1604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597392#action_12597392 ] Jukka Zitting commented on JCR-1604: ------------------------------------ I chatted with Stefan about this, and he mentioned at least the interning of namespace strings being based on solid benchmarks, so we should keep it. The other things might also be worth keeping, especially if we put some effort in reducing the number of separate Name instances kept around. The background for this proposal is that I've been looking at ways of reducing the memory impact of large transient spaces (or large item caches), and reducing the size of NameImpl would contribute a bit (~1%). > NameImpl improvements > --------------------- > > Key: JCR-1604 > URL: https://issues.apache.org/jira/browse/JCR-1604 > Project: Jackrabbit > Issue Type: Improvement > Components: jackrabbit-jcr-commons > Reporter: Jukka Zitting > Priority: Minor > Attachments: NameImpl.patch > > > I'd like to propose the following changes to NameImpl in jackrabbit-jcr-commons: > 1) Don't intern the namespace string. Most often the namespace string is in any case coming from a namespace registry, so there aren't that many copies of the same strings lying around. Also, I don't think the performance impact on NameImpl.equals() is significant even if there are multiple copies of the same namespace string. > 2) Don't memorize the hash code. Since String already memorizes its hash code, the cost of NameImpl.hashCode() is just a few bytecode instructions. I don't think the performance benefit is worth the extra complexity and memory overhead. > 3) Don't memoize the string representation. NameImpl.toString() method is typically only invoked when debugging or when serializing name values. In both cases the CPU overhead of recreating the string is insignificant and IMHO not worth the memory overhead . > I'll attach the patch. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.