You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bval.apache.org by "Jarek Gawor (JIRA)" <ji...@apache.org> on 2012/10/02 20:05:07 UTC

[jira] [Updated] (BVAL-113) Minor performance improvements

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

Jarek Gawor updated BVAL-113:
-----------------------------

    Attachment: PerfTest.java

I attached the test I used to generate the performance results for MetaBean.
                
> Minor performance improvements
> ------------------------------
>
>                 Key: BVAL-113
>                 URL: https://issues.apache.org/jira/browse/BVAL-113
>             Project: BVal
>          Issue Type: Improvement
>          Components: jsr303
>    Affects Versions: 0.4, 0.5
>            Reporter: Jarek Gawor
>         Attachments: BVAL-113.patch, PerfTest.java
>
>
> We found a couple of minor performance issues that came up during our profiling: 
> 1) AnnotationProcessor.java, FeaturesCapable.java, and MetaBean.java use ArrayUtils.add() to grow the array. The issue is that ArrayUtils.add() uses reflection to grown the array which 1) is slower then just instantiating the array, and 2) is completely unnecessary in these cases as the type of the array is always well known and doesn't change.
> 2) MetaBean.java stores MetaProperty objects in a sorted array and uses binary search to lookup and insert them. An implementation that stores these objects in a map would offer faster lookup and insert performance.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira