You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Carl-Eric Menzel (JIRA)" <ji...@apache.org> on 2012/05/06 18:43:50 UTC

[jira] [Commented] (WICKET-4524) ListMultipleChoice has a performance issue with very large lists, patch included

    [ https://issues.apache.org/jira/browse/WICKET-4524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13269254#comment-13269254 ] 

Carl-Eric Menzel commented on WICKET-4524:
------------------------------------------

I agree with the general sentiment here, but there's a problem: The list of choices is not necessarily static, it could also be a model with changing contents. This would be broken by generating a one-time hashmap snapshot.

Instead, I propose adding a FixedChoicesListMultipleChoice component that extends LMC explicitly for this situation and so can use a map to cache the IDs. Be aware of possibly high memory use though!
                
> ListMultipleChoice has a performance issue with very large lists, patch included
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-4524
>                 URL: https://issues.apache.org/jira/browse/WICKET-4524
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.20
>            Reporter: Martin Makundi
>            Priority: Minor
>              Labels: performance
>         Attachments: patch.txt
>
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> If ListMultipleChoice has thousands of options, the convertChoiceIdsToChoices method will become a performance bottleneck because it has a O(N^2) algorithm for determining the selected items. This patch suggests an optimization using a HashMap which will have a performance improvement in cases of large choices lists (users typically 'select all' in such situation).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira