Project

General

Profile

Actions

task #7785

closed

CdmUserHelper caches permission information

Added by Andreas Kohlbecker over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Priority14
Category:
cdm-vaadin
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
normal

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

picture159-1.png (103 KB) picture159-1.png Andreas Kohlbecker, 09/21/2018 04:25 PM

Related issues

Related to EDIT - bug #7709: CdmTransientEntityCacher cannot handle multiple unpersisted entities of the same typeFeedbackKatja Luther

Actions
Actions #1

Updated by Andreas Kohlbecker over 4 years ago

  • Tags changed from phycobank to phycobank, performance
Actions #2

Updated by Andreas Kohlbecker over 4 years ago

Can the cache of the presenter be used in the CdmUserHelper to avoid loading the entities again?

Actions #3

Updated by Andreas Kohlbecker over 4 years ago

  • Priority changed from New to Highest
Actions #4

Updated by Andreas Kohlbecker over 4 years ago

  • Blocked by bug #7709: CdmTransientEntityCacher cannot handle multiple unpersisted entities of the same type added
Actions #5

Updated by Andreas Müller over 4 years ago

Can you define what functionality is exactly needed from the CdmTransientEntityCacher and why #7709 needs to be fixed for this. Currently it is not planned to "fix" #7709 as it seems not to be needed for standard usecases and the new implementation is worse for in terms of memory.

Actions #6

Updated by Andreas Kohlbecker over 4 years ago

  • Description updated (diff)

Answer is in the updated description.

Actions #7

Updated by Andreas Kohlbecker over 4 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50
Actions #8

Updated by Andreas Kohlbecker over 4 years ago

  • Description updated (diff)
  • Assignee changed from Andreas Kohlbecker to Andreas Müller

Implemented and description updated.

Actions #9

Updated by Andreas Müller over 4 years ago

Sorry, currently I don't have time for review. But if it works for you review is not critical I think.

Actions #10

Updated by Andreas Müller over 4 years ago

  • Priority changed from Highest to Priority14
Actions #11

Updated by Andreas Kohlbecker about 4 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.

Actions #12

Updated by Andreas Kohlbecker about 4 years ago

  • Blocked by deleted (bug #7709: CdmTransientEntityCacher cannot handle multiple unpersisted entities of the same type)
Actions #13

Updated by Andreas Kohlbecker about 4 years ago

  • Related to bug #7709: CdmTransientEntityCacher cannot handle multiple unpersisted entities of the same type added
Actions #14

Updated by Andreas Kohlbecker about 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF