You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Mark Struberg (Resolved) (JIRA)" <ji...@apache.org> on 2012/03/30 12:52:28 UTC
[jira] [Resolved] (OWB-639) [perf]
InjectionResolver.getBeanCacheKey creates many StringBuilder instances
[ https://issues.apache.org/jira/browse/OWB-639?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Struberg resolved OWB-639.
-------------------------------
Resolution: Fixed
Txs 4 the catch! We are now using a cache based solution.
> [perf] InjectionResolver.getBeanCacheKey creates many StringBuilder instances
> -----------------------------------------------------------------------------
>
> Key: OWB-639
> URL: https://issues.apache.org/jira/browse/OWB-639
> Project: OpenWebBeans
> Issue Type: Improvement
> Components: Core
> Affects Versions: 1.1.4
> Environment: OWB trunk
> Reporter: Martin Kočí
> Assignee: Mark Struberg
> Priority: Minor
> Fix For: 1.1.4
>
> Attachments: OWB-639.patch
>
>
> InjectionResolver.getBeanCacheKey(Type, String, Annotation...) creates:
> 1) calls java.lang.reflect.Type.toString() -> java.lang.Class.toString() : -> first StringBuilder
> 2) StringBuilder cacheKey = new StringBuilder() -> second StringBuilder
> 3) java.lang.annotation.Annotation.toString() -> many annotation types (for example javax.enterprise.util.AnnotationLiteral.toString())) create toString() output with another StringBuilder() -> third StringBuilder
> Questions:
> toString() methods are normally non-semantics and produce a debug String output. OWB InjectionResolver.getBeanCacheKey uses them to create a key: but are toString() really suitable for this? What if two different annotations produce same toString output? Can be a.getClass().getName() used for 3) ?
> Can be a small class Key better (in terms of memory allocation and GC collection) in this situation?
--
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