Dear Eelco and Jonathan,

Thanks for all your effort put into clarifying this issue.

I will have a look at the caching approach, and for sure see how I can reuse
the panel data. And YourKit really looks like a great profiling tool, thanks
for the tip, didn't know it before! :)

I have an idea how I could optimize the Panel creation based on your
suggestions, please tell me if this makes sense: I could store data like
UserData, Friendslist, etc. to the user session, and attach it to the
Components of the Panel using a PropertyModel. Then, data is only stored one
time in the session. Does this work? What's the maximum size of the user
session?

Kind regards,
Bernd



Eelco Hillenius wrote:
> 
>> MyPanel.java
>> public class MyPanel extends Panel {
>>   public MyPanel() {
>>     // THIS PANEL IS RECONSTRUCTED ON EACH MyPage REQUEST
>>     // BECAUSE MyPageTemplate DOES A new MyPanel...
>>   }
>> }
>>
>> What could I do to use the old panel again?
> 
> Like Al hinted, you should not try to use the old panel again, but
> instead focus on more fruitful forms of optimization. The construction
> of Wicket components isn't very expensive in itself. What typically
> makes it expensive is the data you expose through it, either using
> models or directly. So what you should do is cache/ reuse the data
> where you can, so that you avoid database round trips and other
> expensive processing.
> 
> Often, the best thing to do when it comes to optimizing is to use a
> profiler (YourKit for instance). Optimizing without using a profiler
> to determine what the bottlenecks probably means you're optimizing the
> wrong things.
> 
> Eelco
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-instanciate-panels-best--tf4855189.html#a13909086
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to