jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "angela (JIRA)" <j...@apache.org>
Subject [jira] Updated: (JCR-1604) NameImpl improvements
Date Thu, 16 Oct 2008 07:12:44 GMT

     [ https://issues.apache.org/jira/browse/JCR-1604?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

angela updated JCR-1604:

    Component/s:     (was: jackrabbit-jcr-commons)

changing component to jackrabbit-spi-commons

> NameImpl improvements
> ---------------------
>                 Key: JCR-1604
>                 URL: https://issues.apache.org/jira/browse/JCR-1604
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-spi-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.

View raw message