You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Seifert (JIRA)" <ji...@apache.org> on 2015/01/23 00:22:36 UTC

[jira] [Resolved] (SLING-4112) Sling Models: Optimize performance when read sling models annotations

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

Stefan Seifert resolved SLING-4112.
-----------------------------------
    Resolution: Fixed

Completed: At revision: 1654097  

updated documentation to recommend StaticInjectAnnotationProcessorFactory as default entry point for custom annotation processor factories.

> Sling Models: Optimize performance when read sling models annotations
> ---------------------------------------------------------------------
>
>                 Key: SLING-4112
>                 URL: https://issues.apache.org/jira/browse/SLING-4112
>             Project: Sling
>          Issue Type: Improvement
>          Components: Extensions
>    Affects Versions: Sling Models Implementation 1.1.0
>            Reporter: Stefan Seifert
>            Assignee: Stefan Seifert
>            Priority: Minor
>              Labels: models
>             Fix For: Sling Models Impl 1.2.0
>
>         Attachments: 141028_adaptto_jprofiler_slingmodels.gif, 141028_adaptto_jprofiler_slingmodels_getannotation.gif, 141030_jmeter_with_models_tuning.gif, 141030_jmeter_without_models_tuning.gif, 141030_jprofiler_with_models_tuning_models.gif, 141030_jprofiler_with_models_tuning_total_grouped.gif, 141030_jprofiler_without_models_tuning_models.gif, 141030_jprofiler_without_models_tuning_total_grouped.gif
>
>
> i did some first performance tests with a sling application that makes intensive usage of sling models to see where potential hotspots are that cost performance, esp. in area of sling models.
> attached is a filtered view of a jprofile session showing only the method calls inside sling models implementation:
> [^141028_adaptto_jprofiler_slingmodels.gif]
> a good part of performance is spent on inspection the annotations of the sling models classes, a call graph of the first method: [^141028_adaptto_jprofiler_slingmodels_getannotation.gif]
> i think this is especially the case because this inspection takes place on each adaptTo() call, although the underlying model class never changes when the OSGi bundle stays in place.
> it should be possible to come up with an optimization caching the inspection results (which annotations exist on which fields/methods/types with which parameters), and doing only the injection part on each adaptTo() invocation. if the bundle changes the cache has to be cleared.
> i will think about it the next days and perhaps come up with an implementation proposal.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)