[
https://issues.apache.org/jira/browse/MYFACES-3144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051202#comment-13051202
]
Jakob Korherr commented on MYFACES-3144:
----------------------------------------
I agree with Leonardo. String operations are usually not as cheap as you would
think, and HashMap lookups are usually not as expensive as you would think!
However, note that normally the renderer of a component does not change at all.
In most cases there is one renderer per component and also even only one
render-kit: HTML_BASIC (there are really not many JSF apps using more than one
renderkit at this time). So it would make sence to really implement the cache
without the String comparisons of renderKitId, family and rendererType. Of
course, this should only work via a custom init parameter, which is false by
default, in order to allow applications with multiple renderers or renderkits
to work.
> [PERF] Cache renderer in UIComponentBase
> ----------------------------------------
>
> Key: MYFACES-3144
> URL: https://issues.apache.org/jira/browse/MYFACES-3144
> Project: MyFaces Core
> Issue Type: New Feature
> Components: General
> Affects Versions: 2.1.0-SNAPSHOT
> Environment: myfaces core trunk
> Reporter: Martin Kočí
> Assignee: Martin Kočí
> Attachments: MYFACES-3144.patch
>
>
> UIComponentBase uses getRenderer(): Renderer in five methods:
> 1) decode
> 2) encodeBegin
> 3) encodeChildren
> 4) encodeEnd
> 50 getClientId
> getting the renderer is not cheap if you have thousands component in view.
> Cache renderer instance in UIComponentBase (Trinidad UIXComponentBase does it
> already)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira