You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2013/07/04 10:57:22 UTC

[jira] [Resolved] (SLING-2930) Wasted work in ClusterViewServiceImpl.getClusterView()

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

Carsten Ziegeler resolved SLING-2930.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: Discovery Impl 1.0.0
         Assignee: Carsten Ziegeler

Thanks for your patch, it's applied
                
> Wasted work in ClusterViewServiceImpl.getClusterView()
> ------------------------------------------------------
>
>                 Key: SLING-2930
>                 URL: https://issues.apache.org/jira/browse/SLING-2930
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>         Environment: any
>            Reporter: Adrian Nistor
>            Assignee: Carsten Ziegeler
>              Labels: patch, performance
>             Fix For: Discovery Impl 1.0.0
>
>         Attachments: patch.diff
>
>
> The problem appears in revision 1495454.  I attached a one-line patch
> that fixes it.
> In method "ClusterViewServiceImpl.getClusterView", the loop over
> "clusterViewImpl.getInstances()" should break immediately after
> "foundLocal" is set to "true".  All the iterations after "foundLocal"
> is set to "true" do not perform any useful work, at best they just set
> "foundLocal" again to "true".
> Method "isLive" in class "ResourceResolverContext" has a similar loop
> (over "dynamicProviders"), and this loop breaks immediately after
> "result" is set to "false", just like in the proposed patch.  Other
> methods (e.g., "FactoryPreconditions.checkPreconditions",
> "JspUtil.checkAttributes", "EclipseJavaCompiler.compile",
> "SecondPassVisitor.appendPageDirective") also have similar loops with
> similar breaks, just like in the proposed patch.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira