Hi,

On Tue, Jun 25, 2013 at 5:20 PM, gmparker2000 <greg.par...@brovada.com>wrote:

> Considering two alternative ways to set a model:
>
>         ...
>         final CompoundPropertyModel myModel = new
> CompoundPropertyModel(myObject);
>
>         control1.setModel(myModel.bind("field1"));
>         control2.setModel(myModel.bind("field2"));
>         control3.setModel(myModel.bind("field3"));
>         ...
>
> and
>         ...
>         control1.setModel(new PropertyModel(myObject, "field1));
>         control2.setModel(new PropertyModel(myObject, "field2));
>         control3.setModel(new PropertyModel(myObject, "field3));
>         ...
>
> are there any performance benefits of one over the other?  I profiled each
> and they appear equivalent from the number of objects created point of
> view.
> I just want to make sure that option two isn't doing something like
> serializing "myObject" for each control.  It doesn't appear that this is
> happening but wanted to make sure.
>

Java serialization writes a given instance just once and all following
writes of the same instance will write just pointers to the first write


>
> We are binding controls to fairly large nested Java Objects.  Other than
> making sure to use LoadableDetachable models where possible are there any
> other strategies for making sure performance is optimal?  For example,
> would
> setting the model on the form rather than on each control have any
> performance benefit?
>
> Thanks
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Model-performance-question-tp4659771.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to