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 (Commented) (JIRA)" <ji...@apache.org> on 2012/03/14 14:48:38 UTC

[jira] [Commented] (SLING-2255) Improve JcrResourceResolver#resolve performance when big number of vanityPath are present

    [ https://issues.apache.org/jira/browse/SLING-2255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13229194#comment-13229194 ] 

Carsten Ziegeler commented on SLING-2255:
-----------------------------------------

Thanks Antonio for all the hard work! I've committed a slightly different version which is based on your ideas in revision 1300543

The vanity paths are added under their path to a map - when the map entries are queried from the resource resolver during resolving, an iterator is returned which internally iterates over the entries from the map. The iterator ensures that the sort order is respected without creating temporary arrays.

The tests and integration tests run fine with these changes, but I'll leave this issue open for further comments and tests.
                
> Improve JcrResourceResolver#resolve performance when big number of vanityPath are present
> -----------------------------------------------------------------------------------------
>
>                 Key: SLING-2255
>                 URL: https://issues.apache.org/jira/browse/SLING-2255
>             Project: Sling
>          Issue Type: Improvement
>          Components: JCR
>    Affects Versions: JCR Resource 2.0.10
>            Reporter: Antonio Sanso
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: JCR Resource 2.1.0
>
>         Attachments: SLING-2255.txt, performance.pdf
>
>
> At the moment the performance of JcrResourceResolver#resolve is tight with the number of sling:vanityPath present in the repository.
> Large number of vanityPath means large response time  specially in the worse case scenario (namely huge number of vanityPath and request that doesn't match any vanityPath) but also in the average cases.
> Sling currently employs generic regexps also for vanityPath, but since the regex behind a vanityPath is well know there is room for optimization.
> I'll attach a graphs that shows the situation and a potential patch.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira