You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Nick Johnson (JIRA)" <ji...@apache.org> on 2007/08/24 00:30:30 UTC
[jira] Commented: (WICKET-876) Assigning Label to anchor tag in
recursive ListView causes exponential performance decay
[ https://issues.apache.org/jira/browse/WICKET-876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522294 ]
Nick Johnson commented on WICKET-876:
-------------------------------------
As an aside, I was incorrect in identifying the rate of decay as exponential; it's actually polynomial, following the formula (n + n^2) / 2. (O(n^2)) Bad enough to be very noticeable, but very easy to correct.
Thanks for the explanation!
> Assigning Label to anchor tag in recursive ListView causes exponential performance decay
> ----------------------------------------------------------------------------------------
>
> Key: WICKET-876
> URL: https://issues.apache.org/jira/browse/WICKET-876
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.2.6
> Reporter: Nick Johnson
> Assignee: Igor Vaynberg
> Priority: Trivial
>
> This isn't so much a bug as a curiosity, and I'm partially just documenting this in case someone else runs across the same problem later and searches the bug database for clues. It -would- be interesting to figure out why it happens. The workaround is trivial.
> If the markup for a recursive list view (like the recursive panel in the examples) contains a named anchor like this:
> <a name="x" wicket:id="anchor"> </a>
> And the anchor is (inappropriately) associated with a Label like this:
> add(new Label("anchor").add(new SimpleAttributeModifier("name","foo")));
> Then as the levels of recursion deepen, performance during rendering decays exponentially. During this time, the Java process will also start consuming a tremendous amount of CPU.
> The solution is fairly simple: don't use a Label for situations like this; instead, use a WebMarkupContainer:
> add(new WebMarkupContainer("anchor").add(new SimpleAttributeModifier("name","foo")));
> With the component being WebMarkupContainer, performance does not degrade exponentially. With Label, it does. I'm afraid I don't know enough of the internal workings of Wicket to speculate as to why.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.