Lukas Eder created SLING-2787:
---------------------------------
Summary: 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
Priority: Minor
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