You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@syncope.apache.org by gonzalad <gi...@git.apache.org> on 2016/08/29 13:56:48 UTC

[GitHub] syncope pull request #36: Startup performance tweaks : restrict startup scan...

GitHub user gonzalad opened a pull request:

    https://github.com/apache/syncope/pull/36

    Startup performance tweaks : restrict startup scanning to syncope packages

    Without this PR, standalone tomcat startup takes 135s (by default, syncope scans all packages).
    With this PR, it takes 32s.
    
    Startup scanning is restricted to packages : 
     * org.apache.syncope.client.console
     * org.apache.syncope.fit.core
     * org.apache.syncope.core

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gonzalad/syncope 2.0.0-M2-startup-perf1

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/syncope/pull/36.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #36
    
----
commit 9d756e830db78c2c754adbc8010d4c3079e3ddc7
Author: Adrian Gonzalez <ad...@yahoo.fr>
Date:   2016-08-29T09:36:44Z

    Startup performance tweaks
    
    Restrict startup scanning to syncope packages.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request #36: Startup performance tweaks : restrict startup scan...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/36#discussion_r77491727
  
    --- Diff: core/logic/src/main/java/org/apache/syncope/core/logic/init/ClassPathScanImplementationLookup.java ---
    @@ -74,6 +75,8 @@
         private Map<Class<? extends AccountRuleConf>, Class<? extends AccountRule>> accountRuleClasses;
     
         private Map<Class<? extends PasswordRuleConf>, Class<? extends PasswordRule>> passwordRuleClasses;
    +    
    +    private List<String> basePackages = Arrays.asList("org.apache.syncope.fit.core", "org.apache.syncope.core");
    --- End diff --
    
    Prior to this change, one could create classes, in its own Maven-based Syncope project, under any package, now it is forced to do it under `org.apache.syncope.client.console` but we got more startup speed.
    I guess it is an acceptable trade-off.
    
    LGTM.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request #36: Startup performance tweaks : restrict startup scan...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/36#discussion_r77491754
  
    --- Diff: core/logic/src/main/java/org/apache/syncope/core/logic/init/ClassPathScanImplementationLookup.java ---
    @@ -226,5 +233,15 @@ public void load() {
     
             return passwordRuleClasses.get(passwordRuleConfClass);
         }
    +    
    +    /**
    +     * @return basePackages for syncope class classpath scanning
    +     */
    +    protected List<String> getBasePackages() {
    --- End diff --
    
    Did not get what this method was for, at a first glance, then I've realized it might be used for subclasses: please mention this in the javadoc.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request #36: Startup performance tweaks : restrict startup scan...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/36#discussion_r77492468
  
    --- Diff: core/logic/src/main/java/org/apache/syncope/core/logic/init/ClassPathScanImplementationLookup.java ---
    @@ -74,6 +75,8 @@
         private Map<Class<? extends AccountRuleConf>, Class<? extends AccountRule>> accountRuleClasses;
     
         private Map<Class<? extends PasswordRuleConf>, Class<? extends PasswordRule>> passwordRuleClasses;
    +    
    +    private List<String> basePackages = Arrays.asList("org.apache.syncope.fit.core", "org.apache.syncope.core");
    --- End diff --
    
    A simple `String` field should do the job.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request #36: Startup performance tweaks : restrict startup scan...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/36#discussion_r77491706
  
    --- Diff: client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java ---
    @@ -51,6 +53,8 @@
         private List<Class<? extends BaseExtPage>> extPages;
     
         private List<Class<? extends BaseExtWidget>> extWidgets;
    +    
    +    private List<String> basePackages = Arrays.asList("org.apache.syncope.client.console");
    --- End diff --
    
    Prior to this change, one could create classes, in its own Maven-based Syncope project, under any package, now it is forced to do it under `org.apache.syncope.client.console` but we got more startup speed.
    I guess it is an acceptable trade-off.
    
    LGTM.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope issue #36: Startup performance tweaks : restrict startup scanning to...

Posted by gonzalad <gi...@git.apache.org>.
Github user gonzalad commented on the issue:

    https://github.com/apache/syncope/pull/36
  
    Hi Francesco, 
    I've just incorporated your remarks in a second commit.
    Couldn't test it with my sample apps though (I'm not at work now).
    Let me know if something needs to be changed.
    
    Thanks, 
    Adrian


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request #36: Startup performance tweaks : restrict startup scan...

Posted by gonzalad <gi...@git.apache.org>.
Github user gonzalad commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/36#discussion_r77550239
  
    --- Diff: client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java ---
    @@ -51,6 +53,8 @@
         private List<Class<? extends BaseExtPage>> extPages;
     
         private List<Class<? extends BaseExtWidget>> extWidgets;
    +    
    +    private List<String> basePackages = Arrays.asList("org.apache.syncope.client.console");
    --- End diff --
    
    I've implemented with a List<String> in order to have a similar implementation as in core.logic.init.ClassPathScanImplementationLookup.
    
    Just tell me if you really want it to be a simple String, I'll change it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request #36: Startup performance tweaks : restrict startup scan...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/36#discussion_r77491786
  
    --- Diff: core/logic/src/main/java/org/apache/syncope/core/logic/init/ClassPathScanImplementationLookup.java ---
    @@ -226,5 +233,15 @@ public void load() {
     
             return passwordRuleClasses.get(passwordRuleConfClass);
         }
    +    
    +    /**
    +     * @return basePackages for syncope class classpath scanning
    +     */
    +    protected List<String> getBasePackages() {
    +        return basePackages;
    +    }
     
    +    public void setBasePackages(final List<String> basePackages) {
    --- End diff --
    
    Who is supposed to invoke this method? I would remove it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope issue #36: Startup performance tweaks : restrict startup scanning to...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on the issue:

    https://github.com/apache/syncope/pull/36
  
    Thanks @gonzalad !
    I have changed some small details and squashed into a single commit.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request #36: Startup performance tweaks : restrict startup scan...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/36#discussion_r77491348
  
    --- Diff: client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java ---
    @@ -161,5 +169,15 @@ public int compare(
         public List<Class<? extends BaseExtWidget>> getExtWidgetClasses() {
             return extWidgets;
         }
    +    
    +    /**
    +     * @return basePackages for syncope class classpath scanning
    +     */
    +    protected List<String> getBasePackages() {
    +        return basePackages;
    +    }
     
    +    public void setBasePackages(final List<String> basePackages) {
    --- End diff --
    
    Who is supposed to invoke this method? I would remove it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope issue #36: Startup performance tweaks : restrict startup scanning to...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on the issue:

    https://github.com/apache/syncope/pull/36
  
    Linking to SYNCOPE-926


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request #36: Startup performance tweaks : restrict startup scan...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/36#discussion_r77491468
  
    --- Diff: client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java ---
    @@ -161,5 +169,15 @@ public int compare(
         public List<Class<? extends BaseExtWidget>> getExtWidgetClasses() {
             return extWidgets;
         }
    +    
    +    /**
    +     * @return basePackages for syncope class classpath scanning
    +     */
    +    protected List<String> getBasePackages() {
    --- End diff --
    
    Did not get what this method was for, at a first glance, then I've realized it might be used for subclasses: please mention this in the javadoc.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request #36: Startup performance tweaks : restrict startup scan...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/36#discussion_r77492458
  
    --- Diff: client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java ---
    @@ -51,6 +53,8 @@
         private List<Class<? extends BaseExtPage>> extPages;
     
         private List<Class<? extends BaseExtWidget>> extWidgets;
    +    
    +    private List<String> basePackages = Arrays.asList("org.apache.syncope.client.console");
    --- End diff --
    
    A simple `String` field should do the job.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request #36: Startup performance tweaks : restrict startup scan...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/syncope/pull/36


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope issue #36: Startup performance tweaks : restrict startup scanning to...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on the issue:

    https://github.com/apache/syncope/pull/36
  
    The PR looks good - please apply the suggested changes and I'll merge it.
    
    Pleae also consider that from 2.0.0.M5 we have added [ITImplementationLookup](https://github.com/apache/syncope/blob/master/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java) for integration tests and standalone, which skips classpath lookup completely.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---