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

Thomas Andraschko updated OWB-1455:
-----------------------------------
    Description: 
InjectionResolver#implResolveByType already caches successful resolutions in 
resolvedBeansByType, but misses were not stored. Repeated getBeans(Type, 
qualifiers) for the same unsatisfied key therefore rescanned the full 
deployment every time, which is costly for workloads that probe many 
non-existent types (e.g. Mojarra).

After startup (!startup), store an empty result as Collections.emptySet() under 
the same BeanCacheKey used for hits, so later lookups are O(1) map hits. 
clearCaches() continues to drop these entries with the rest of the resolver 
cache.

Aligns with the intent of TomEE’s openejb.cache.cdi-type-resolution-failure.

  was:InjectionResolver#implResolveByType does not cache have a negative cache


> [perf] cache negative results of resolveByType
> ----------------------------------------------
>
>                 Key: OWB-1455
>                 URL: https://issues.apache.org/jira/browse/OWB-1455
>             Project: OpenWebBeans
>          Issue Type: Task
>    Affects Versions: 4.0.3
>            Reporter: Thomas Andraschko
>            Assignee: Thomas Andraschko
>            Priority: Major
>             Fix For: 4.1.0
>
>
> InjectionResolver#implResolveByType already caches successful resolutions in 
> resolvedBeansByType, but misses were not stored. Repeated getBeans(Type, 
> qualifiers) for the same unsatisfied key therefore rescanned the full 
> deployment every time, which is costly for workloads that probe many 
> non-existent types (e.g. Mojarra).
> After startup (!startup), store an empty result as Collections.emptySet() 
> under the same BeanCacheKey used for hits, so later lookups are O(1) map 
> hits. clearCaches() continues to drop these entries with the rest of the 
> resolver cache.
> Aligns with the intent of TomEE’s openejb.cache.cdi-type-resolution-failure.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to