You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Joel Uckelman <uc...@nomic.net> on 2008/10/17 11:52:18 UTC
reuse of SAXSVDDocumentFactory
I'm loading a large number of small SVG images across several threads.
Right now, my class which does this, SVGRenderer, has a static
SAXSVGDocumentFactory which is used by all instances. Becasue
SAXSVGDocumentFactory has some internal state, I synchronize on my
static instance so that only one thread uses it at a time:
synchronized (docFactory) {
doc = docFactory.createDocument(file, in);
}
My question is whether there's any benefit to having a single static
SAXSVGDocumentFactory instead of giving each one of my SVGRenderers
its own. I'm not aware of what SAXSVGDocumentFactory is doing, so I
don't have a clear picture of what the costs would be of creating
several thousand of them as opposed to synchronizing on one.
--
J.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org