Josias Thoeny wrote:
Just noticed that for each request for a document in lenya-trunk, the
DefaultDocument class gets instantiated about 300 times (put some debug
output into the constructor to see it).
Could the DocumentBuilder somehow use the DocumentIdentityMap to prevent
multiple document instantiation?
Or might that lead to problems, e.g. with synchronization if multiple
threads access the same document simultaneously?


I guess that the main reason for this behaviour is that the preconditions
are verified for all usecases which are available in the menubar.

I found out that this is not true. There is a bug somewhere, documents seem
to be instanciated multiple times for the same repository session.


I think quite a large number of document instances are created in input
modules (and maybe other sitemap components).
Many input modules use the following code:

Document document = getEnvelope(objectModel, name).getDocument();

which 'often' creates a new instance of the document, because the
InputModules don't seem to be re-used.

My question is:
How is this related to repository sessions?

Actually the identity map is attached to the repository session, which means
that already built documents should be taken from there.

Should the input modules (or other sitemap components) use the
repository session attached to the request to access the document?

At the moment they do (because the LenyaSourceFactory uses this session).
But in the future this probably has to be changed (see thread "Isolation of
active / inactive usecases").

BTW, I just committed some changes to the publication classes which seem
to have increased the performance (from about 7 to about 4 seconds per
authoring request on my machine). I hope this has removed some overhead.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to