You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2013/03/19 18:21:17 UTC
[jira] [Assigned] (SLING-2787) Inefficient array conversion in
ValueMapDecorator.convertToArray()
[ https://issues.apache.org/jira/browse/SLING-2787?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler reassigned SLING-2787:
---------------------------------------
Assignee: Carsten Ziegeler
> Inefficient array conversion in ValueMapDecorator.convertToArray()
> ------------------------------------------------------------------
>
> Key: SLING-2787
> URL: https://issues.apache.org/jira/browse/SLING-2787
> Project: Sling
> Issue Type: Bug
> Components: API
> Affects Versions: API 2.3.0
> Reporter: Lukas Eder
> Assignee: Carsten Ziegeler
> Priority: Minor
> Attachments: ValueMapDecorator.java.patch, ValueMapTest.java
>
>
> The method ValueMapDecorator.convertToArray() seems to have a rather canonical implementation, which can be improved significantly. The roundtrip via a temporary LinkedList seems unnecessary and leads to a significant performance loss in "high throughput" test scenarios. Attached, you'll find a test case leading to the below results:
> Run with 10000000 repetitions.
> String[] -> Integer[]: 1464.146 ms
> String -> Integer[]: 826.171 ms
> After applying the attached patch, the results improve significantly:
> Run with 10000000 repetitions.
> String[] -> Integer[]: 1010.143 ms
> String -> Integer[]: 524.219 ms
> While the effect of the improvement is less significant in a "real-world" scenario, I still think it is worth improving this central API class
--
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