cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Tripodi <simone.trip...@gmail.com>
Subject [Cocoon 3] Optimizing resources creation on SAX pipeline components
Date Sun, 24 Jan 2010 15:45:34 GMT
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/

Mime
View raw message