wicket-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eelco Hillenius" <eelco.hillen...@gmail.com>
Subject Re: LoadableDetachableModel: remove boolean attached
Date Wed, 01 Nov 2006 18:05:05 GMT
I'm not sure. This should be ok 99% of the time, but the two variables
represent two different things. Theoretically, a null value could be a
valid 'attached' result of some expensive load operation (e.g. you
could query a database, but end up with null instead). In that
(unlikely?) case the model could suddenly be quite expensive if used
in multiple components/ occasions.

I could change my mind if you get some drastic results, but for the
moment I'm -1.

Eelco


On 11/1/06, Igor Vaynberg <igor.vaynberg@gmail.com> wrote:
> +1
>
> tell us how it profiles w/out the boolean
>
> -igor
>
>
> On 11/1/06, Martijn Dashorst <martijn.dashorst@gmail.com> wrote:
> >
> > All,
> >
> > While profiling we see that the LoadableDetachableModel uses some
> > memory. Currently the LDM keeps track of whether it is attached in a
> > transient boolean.
> >
> > If we change the semantics that a null tempModelObject == detached,
> > and a non-null tempModelObject == attached, we can remove the boolean
> > and reduce the footprint of the LDM.
> >
> > BTW, the LDM is one of the most commonly used models in our app
> > (37000+ instances in a 60 user session, giving a shallow size of 2.1MB
> > and a retained size of 2.9MB).
> >
> > Any objections or thoughts?
> >
> > Martijn
> >
> > --
> > <a href="http://www.thebeststuffintheworld.com/vote_for/wicket">Vote</a>
> > for <a href="http://www.thebeststuffintheworld.com/stuff/wicket
> > ">Wicket</a>
> > at the <a href="http://www.thebeststuffintheworld.com/">Best Stuff in
> > the World!</a>
> >
>
>

Mime
View raw message