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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]