task #7785
closedCdmUserHelper caches permission information
100%
Description
CdmUserHelper has been identified being hostspot in the cpu time analysis:
Caching entities or permsisson check results may help improving the performance.
In the analyzed case it takes 12 seconds in total to build the RegistrationWorkingsetView. 8,3 seconds of that are only used to find entities which are needed to do permission checks. Finding these entities involves querying the database which naturally takes some time. But these roundtrips to the DB are completely dispensable since the entities needed for the checks have been loaded already. They are stored in the CdmTransientEntityCache
which is used by the CachingPresenters
. Therefore this performance overhead culd be completely cropped off by using the cached enities.
When the permission check is being done, the entityType and UUID are known, but with this information it is not possible to query the CdmTransientEntityCache
for a cached object. The cache uses the entity.ID instead of the uuid. In #7709 the idea of using the uuid
instead of the id
is being discussed.
We (AK & AM) decided for the following solution:
A subclass of the CdmTransientEntityCache
will complements the CdmTransientEntityCache
by the ability to get CDM entities from the cache by the UUID. Internally a Map will be used to store the entity UUID together with the CdmEntityCacheKey of each entity being put into the cache.
Files
Related issues
Updated by Andreas Kohlbecker over 5 years ago
- Tags changed from phycobank to phycobank, performance
Updated by Andreas Kohlbecker over 5 years ago
Can the cache of the presenter be used in the CdmUserHelper to avoid loading the entities again?
Updated by Andreas Kohlbecker over 5 years ago
- Priority changed from New to Highest
Updated by Andreas Kohlbecker over 5 years ago
- Blocked by bug #7709: CdmTransientEntityCacher cannot handle multiple unpersisted entities of the same type added
Updated by Andreas Müller over 5 years ago
Updated by Andreas Kohlbecker over 5 years ago
- Description updated (diff)
Answer is in the updated description.
Updated by Andreas Kohlbecker over 5 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 50
Applied in changeset cdmlib|8bbd4f27e47a00d244480b4f5a01056d415bda27.
Updated by Andreas Kohlbecker over 5 years ago
- Description updated (diff)
- Assignee changed from Andreas Kohlbecker to Andreas Müller
Implemented and description updated.
Updated by Andreas Müller over 5 years ago
Sorry, currently I don't have time for review. But if it works for you review is not critical I think.
Updated by Andreas Müller over 5 years ago
- Priority changed from Highest to Priority14
Updated by Andreas Kohlbecker over 5 years ago
- Assignee changed from Andreas Müller to Andreas Kohlbecker
- % Done changed from 50 to 100
The CachingCdmUserHelper effectively brings a performance boost of ~2 seconds for the big working set "Kulikovskiy, M., Lange-Bertalot, H. & Kuznetsova, I. V., Lake Baikal: Hotspot of endemic diatoms II.Iconographia Diatomologica, 26: [1]-656. 2015" with over 70 acts which takes ~14 seconds to load
Another hotspot is the checking for active messages in the redmine instance used for communication. This imposes mur than 5 seconds!
This issue definitely can be closed as completed. Since CdmTransientEntityAndUuidCacher
has been implemented the issue #7709 is no longer blocking this task.
Updated by Andreas Kohlbecker over 5 years ago
- Blocked by deleted (bug #7709: CdmTransientEntityCacher cannot handle multiple unpersisted entities of the same type)
Updated by Andreas Kohlbecker over 5 years ago
- Related to bug #7709: CdmTransientEntityCacher cannot handle multiple unpersisted entities of the same type added
Updated by Andreas Kohlbecker over 5 years ago
- Status changed from Resolved to Closed