On Thu, 2002-11-28 at 05:37, Stephen Crawley wrote:
> Here are a couple of theoretical reasons why interning (in general)
> could have negative performance implications, for Kissme at least.
> 
>   *  I believe that Classpath's String interning uses a weak hashmap.
>      Unfortunately, Kissme does not support weak references yet.  Instead
>      it treats weak references as ordinary references.  This means that
>      Kissme cannot garbage collect any String that has been interned.

I see.  Well, in practice there's going to be a real limit to the number
of Locale's a program will ever see - so I don't see this as a real
problem.

>   *  You may be aware that the Kissme VM includes an implementation of
>      orthogonal persistence.  In one possible configuration of Kissme
>      O-P, static fields of classes get automatically saved to the
>      persistent store.  This would include String's interning data
>      structures.  Thus interned Strings would last "for ever" in the
>      store.  

I think the same comment applies here.  This doesn't really seem like a
bad thing.

> Note: I'm not saying "don't intern these locale Strings".  If there is
> a demonstrable performance benefit, go for it.

If anywhere there was a use for string interning, I think this is it. 
We're talking about  up to three inline pointer comparisons -vs- up to
three expensive String comparison function calls on each Locale
comparison, and there's a real and practical limit to the number of
strings we'd be interning.

Tom - what would you like to see in order to accept this patch?

AG




_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to