xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: Wolfgang Hoschek <whoschek AT lbl.gov>
- To: Wolfgang Hoschek <whoschek AT lbl.gov>
- Cc: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] QName flyweights
- Date: Fri, 10 Jun 2005 12:57:46 -0700
You just need a weak referenced Map as a cache, and use "double checking", or not, as I don't think it is that dangerous that there are two equal QNames floating around of which only one is saved in the cache...
I'm not sure I understand what you mean with "double checking" and why weak references would be significantly benefitial.
Wolfgang.
If Elliotte would like to continue supporting JDK < 1.4 we could at runtime detect what kind of Map impls are available and choose in the following order of priority:
- bounded java.util.LinkedHashMap with LRU in the way I outlined. By far the best choice wrt. reliability and performance, in my experience. (jdk >= 1.4)
- jakarta commons collections LRUHashMap or a custom stripped down version of it (jdk >= 1.2)
- java.util.WeakHashMap (jdk >= 1.2) without any bounds (not a particulary good choice, but will do the job correctly)
Wolfgang.
-
[XOM-interest] QName flyweights,
Wolfgang Hoschek, 06/09/2005
- Re: [XOM-interest] QName flyweights, Elliotte Harold, 06/09/2005
-
Re: [XOM-interest] QName flyweights,
norwoods, 06/09/2005
-
Re: [XOM-interest] QName flyweights,
Wolfgang Hoschek, 06/09/2005
- Re: [XOM-interest] QName flyweights, Wolfgang Hoschek, 06/09/2005
-
Re: [XOM-interest] QName flyweights,
Metalab, 06/09/2005
-
Re: [XOM-interest] QName flyweights,
Mik Lernout, 06/10/2005
-
Re: [XOM-interest] QName flyweights,
Wolfgang Hoschek, 06/10/2005
-
Re: [XOM-interest] QName flyweights,
Wolfgang Hoschek, 06/10/2005
- Re: [XOM-interest] QName flyweights, norwoods, 06/13/2005
- Re: [XOM-interest] QName flyweights, norwoods, 06/13/2005
- Re: [XOM-interest] QName flyweights, Wolfgang Hoschek, 06/13/2005
- Message not available
- Re: [XOM-interest] QName flyweights, Wolfgang Hoschek, 06/13/2005
-
Re: [XOM-interest] QName flyweights,
Wolfgang Hoschek, 06/10/2005
-
Re: [XOM-interest] QName flyweights,
Wolfgang Hoschek, 06/10/2005
-
Re: [XOM-interest] QName flyweights,
Mik Lernout, 06/10/2005
-
Re: [XOM-interest] QName flyweights,
Wolfgang Hoschek, 06/09/2005
- Re: [XOM-interest] QName flyweights, norwoods, 06/10/2005
Archive powered by MHonArc 2.6.24.