Hi all guys,
I'd like to improve a little the resources creation into C3 SAX pipelines components, saving consumed memory and components initialization time, reusing already created resources.
I mean, instantiating the same kind of XSLTTransformer (or the SchemaProcessorTransformer) twice, in different parts of the application, with the same resource:

class Service1 {

    XSLTTransformer xsltTransformer = new XSLTTransformer(this.getClass().getResource("myStyle.xsl"));
    ...
}

class Service2 {
    XSLTTransformer xsltTransformer = new XSLTTransformer(this.getClass().getResource("myStyle.xsl"));
    ...
}

causes the "myStyle.xsl" resource has to be load twice, consuming memory. As proposed time ago - also mentioned by Sylvain - I'd like to introduce an InMemoryLRU cache that stores and maintains already loaded resources.

What do you think about it? It's a simple improvement I can realize quickly and that's not hard to integrate in the existing code, obviously any kind of help and suggestion is more than welcome! :)
Best regards,
Simo

http://people.apache.org/~simonetripodi/