You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Marcel Reutegger (JIRA)" <ji...@apache.org> on 2007/01/04 11:20:27 UTC

[jira] Reopened: (JCR-689) Minimize calls to PersistenceManager

     [ https://issues.apache.org/jira/browse/JCR-689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger reopened JCR-689:
----------------------------------


There are more situations where the persistence manager is called unnecessarily. While the previously attached patch improves the situation when items are transiently added there are still many unnecessary calls to persistence manager and the access manager when changes are saved.

- As a convenience the methods ItemImpl.validateTransientItems() retrieves item instances based on item states even though all required information is also present in the item state. Retrieving an item instance will always check for access rights which is not necessary in this method. The same applies to ItemImpl.initVersionHistories() and ItemImpl.persistTransientItems().
- The EventStateCollection contains redundant calls to the item state manager for added items.

Attached patch solves this issue. Please review.

> Minimize calls to PersistenceManager
> ------------------------------------
>
>                 Key: JCR-689
>                 URL: https://issues.apache.org/jira/browse/JCR-689
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 0.9, 1.0, 1.0.1, 1.1, 1.1.1
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: JCR-689-r492483.patch, NodeImpl-485720.patch
>
>
> In some situations the PersistenceManager is called even though it is not necessary.
> E.g. when new items are created the method NodeImpl.getOrCreateProperty() will always check if there is an already existing property state. If the node is new the call will always go down the full item state stack and ask the PersistenceManager if it knows the property id. This is unnessessary because there will never exist properties in the persistence manager for a new node that has not been saved yet.
> I propose to add a check to the method to see if  the node is new and does not yet have a property with the given name. In that case the property can be created without further checks.
> With the patch applied the time to transiently create 1000 nodes with 4 properties each drops from 1485 ms to 422 ms.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira