bval-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Benson (JIRA)" <>
Subject [jira] [Commented] (BVAL-154) reduce memory footprint of BeanMeta
Date Tue, 25 Jul 2017 17:00:06 GMT


Matt Benson commented on BVAL-154:

The changes for BV 2.0 IMO exceed the tipping point of being reasonable to implement with
the existing metadata model. [~rmannibucau] has already suggested that the code should be
streamlined away from its BV-agnostic origins, and I agree. I have more or less completed
a proposal for a metadata rewrite locally and have just been waiting for the spec to be finalized
before getting it out there for discussion and community banging. I can certainly incorporate
this idea as well. 

> reduce memory footprint of BeanMeta
> -----------------------------------
>                 Key: BVAL-154
>                 URL:
>             Project: BVal
>          Issue Type: Bug
>          Components: jsr303
>    Affects Versions: 1.1.2
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.3, 2.0.0
> While doing some performance analysis on a project I figured that we store way too many
BeanMeta instances. 
> This seems to come from other frameworks checking whether a class has BeanValidation
features on them. 
> It also happens within our own CDI BValExtension. 
> The result is that we also cache the BeanMeta for every class which gets queried, regardless
whether it has some validation on them or not.
> We should introduce a 'negative cache' which contains classes which are known to have
no validation on them
> {code:java}
> getConstraintForClass(Calss c) {
>   if (negativeCache.contains(c)) 
>     return new EmptyBeanDescription(c);
>   ...
>   if (noValidationFeatureFound)
>     negativeCache.add(c);
> }
> {code}

This message was sent by Atlassian JIRA

View raw message