On Tue, 19 Feb 2013 09:17:55 +0100
Sven Meier <[email protected]> wrote:

> >I don't see how 'B' can have method #bind(IModel)
> 
> Correct, I fixed the example to declare B as LazyModel<B>.
> 
> >I also saw performance tests which verify that LazyModel is at least
> >twice faster than PropertyModel.
> 
> Not quite:
> In my idealized test-case it is at most 2 times *slower* than
> PropertyModel. This holds when each LazyModel is "used" (i.e.
> getObject() called) at least ten times, e.g. in an Ajax heavy
> application where you stay on a single page for a longer time. If
> each LazyModel is used once only (e.g. on a stateless page) it might
> get up to 5 times slower than PropertyModel. That proxying comes at a
> high price, there's no way around it :/. PropertyModel is still the
> king of performance. Or you have to switch to a preprocessor solution
> like bindgen-wicket.

Or you can do it like SafeModel does: Instead of reflecting all the
way, construct the property expression once and simply return an
AbstractPropertyModel. That would also allow some other tricks (we rely
on the property expression being available in my main project).

Carl-Eric

Reply via email to