Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] QName flyweights

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Mik Lernout <mik AT futurestreet.org>
  • To: Metalab <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] QName flyweights
  • Date: Fri, 10 Jun 2005 07:46:31 +0200

My 2 cents: I work a lot in multi-threaded, heavy-usage environments, and those synchronized blocks are way to wide and will crush performance when running in ore than one thread. Elliotte: can you add concurrent access in your test cases.

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...

-mik

Metalab wrote:


On Jun 9, 2005, at 4:01 PM, Wolfgang Hoschek wrote:




setPrefix, setURI, setName, setLocalName are all complicated by flyweight qnames.


They are not significantly more complicated, IMHO. It's always the same simple pattern (and it's commonality can be factored out).




Agreed. These are all uncommon operations anyway. Most applications will never call any of these methods. I wouldn't object to them getting slower if it meant memory were saved and other more common operations

--
Elliotte
_______________________________________________
XOM-interest mailing list
XOM-interest AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest






Archive powered by MHonArc 2.6.24.

Top of Page