The children field is private to Component, so I figure we could make
children transient, double the array size each time each time we add
components if it's not big enough (like ArrayList does), and then in
detach() we could copy the children over to a non-transient variable
and null out the transient field. We should do some cleverness to
avoid the copy if things haven't changed between attach()/detach().

Al

On 11/02/2008, Nino Saturnino Martinez Vazquez Wael
<[EMAIL PROTECTED]> wrote:
> Sorry for previous post.. It was a listview.. not dataview
>
> Meetesh Karia wrote:
> > It appeared to be that way after stepping through the code many times
> > in a debugger but that's definitely not conclusive evidence.  I'll try
> > and come up with a better measure of what's going on.
> >
> > Thanks,
> > Meetesh
> >
> > Matej Knopp wrote:
> >> Indeed, the reason for it is to reduce memory consumption. Right now,
> >> I don't see any easy way around, are you absolutely sure that it
> >> causes you performance problems?
> >>
> >> -Matej
> >>
> >> On Feb 11, 2008 2:15 PM, Meetesh Karia <[EMAIL PROTECTED]> wrote:
> >>
> >>> Hi all, I'm using DataView in wicket 1.3 and we have ~400 items that
> >>> are
> >>> returned by a data provider.  I'd expect the adding of the items to be
> >>> rather quick but it turns out that it's not and it looks like the
> >>> culprit might be MarkupContainer.put.  That method expands the children
> >>> array 1 entry at a time which makes the loop of adding the items n^2.
> >>>
> >>> Is there a good reason for this loop to be n^2 (memory conservation
> >>> perhaps)?  Is there any easy way around it?
> >>>
> >>> Thanks,
> >>> Meetesh
> >>>
> >>>
> >>
> >>
> >>
> >>
> >
>
> --
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to