[gatein-issues] [JBoss JIRA] Created: (GTNPORTAL-338) tune getAllPortalNames method in UserPortalConfigService

Prabhat Jha (JIRA) jira-events at lists.jboss.org
Wed Dec 2 11:50:29 EST 2009


tune getAllPortalNames method in UserPortalConfigService
--------------------------------------------------------

                 Key: GTNPORTAL-338
                 URL: https://jira.jboss.org/jira/browse/GTNPORTAL-338
             Project: GateIn Portal
          Issue Type: Bug
    Affects Versions: 3.0.0-Beta03
            Reporter: Prabhat Jha
             Fix For: 3.0.0-Beta04


Related jira is  https://jira.jboss.org/jira/browse/JBQA-2887 which may not be accessible to all of you so here are details:

I did some profiling with JProfiler. There is no difference between the case with different users and same users test. The biggest bottleneck is the "getAllPortalNames" bottleneck. During processing of HTTP request to the sample page, then about 90% of time is spent in method "getAllPortalNames" from class "org.exoplatfrom.portal.config.UserPortalConfigService". Each call to this method performs several calls to eXo JCR DB. There is no caching here.

Please let me know if a separate jira is needed for following profiling:

I tried to do the test and profiling with Chromattic options disabled and enabled. Chromattic options are four JVM options which can be added to server JVM args to optimize Chromattic library to use caching and avoid calls to eXo JCR DB. Namely these options are here:

-Dorg.chromattic.api.Option.optimize.jcr.enabled=true
-Dorg.chromattic.api.Option.optimize.jcr.has_property.enabled=true
-Dorg.chromattic.api.Option.optimize.jcr.has_node.enabled=true
-Dorg.chromattic.api.Option.cache.state.enabled=true

I verified that there is no any performance improvement with these options enabled and calls to eXo JCR SB are still here. I did some profling and debugging and here are the more detailed results:

1) Significant amount of time is spent in the method getProperty in class org.chromattic.core.jcr.SessionWrapperImpl.

public Property getProperty(Node node, String relPath) throws RepositoryException {
   if (hasPropertyOptimized) {
        return node.getProperty(relPath);
    } else {
      if (node.hasProperty(relPath)) {
        return node.getProperty(relPath);
}

1.a) if chromattic options are disabled (hasPropertyOptimized==false to be more precise), then method node.hasProperty(relPath) performs call to eXo DB but method node.getProperty(relPath) doesn't perform any additional calls to DB, because data are cached inside of cache in org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager.

1.b) if chromattic options are enabled, then only method node.getProperty(relPath) is called but this method performs calls to DB because these data are not cached inside CacheableWorkspaceDataManager.

So the conclusion is, that there is no any benefit when hasPropertyOptimized is true.

2) If cacheState is enabled (option -Dorg.chromattic.api.Option.cache.state.enabled=true) then there is non-null variable "propertyCache" inside "org.chromattic.core.PersistentEntityContextState". When method "getPropertyValue" on class "PersistentEntityContextState" is called, then nothing is found inside the cache and founded items are not saved to propertyCache.
New items are put to propertyCache only when "setPropertyValue" is called, but this method is not called during HTTP request processing. So the propertyCache is always empty. 

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

        


More information about the gatein-issues mailing list