You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Meetesh Karia <me...@gmail.com> on 2008/02/11 14:15:16 UTC

n^2 loop in MarkupContainer?

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

Re: Pickup up new markup without restarting webapp

Posted by Igor Vaynberg <ig...@gmail.com>.
see internalinit in webapplication/application and how it sets up the
resource monitoring thread that reloads resources when the app is in
dev mode....

-igor


On Thu, Feb 28, 2008 at 4:37 PM, Chris Colman
<ch...@stepaheadsoftware.com> wrote:
> > Chris,
>  >
>  > I'm not that familiar with the inner workings of the API but based on
>  the
>  > description in the Javadoc, I think you are going to need to provide a
>  > custom implementation of IMarkupCache.
>  >
>  > If you are looking for a simpler solution, you could enter an RFE for
>  new
>  > property on iMarkupSettings that replicates the DEV mode markup reload
>  > functionality.
>
>  Yeah, that would be excellent - a setting that causes the markup loader
>  to check for the existence of a piece of markup (possibly a variant) in
>  the file system if it can not be found in the cache.
>
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>  For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Pickup up new markup without restarting webapp

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
> Chris,
> 
> I'm not that familiar with the inner workings of the API but based on
the
> description in the Javadoc, I think you are going to need to provide a
> custom implementation of IMarkupCache.
> 
> If you are looking for a simpler solution, you could enter an RFE for
new
> property on iMarkupSettings that replicates the DEV mode markup reload
> functionality.

Yeah, that would be excellent - a setting that causes the markup loader
to check for the existence of a piece of markup (possibly a variant) in
the file system if it can not be found in the cache.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Pickup up new markup without restarting webapp

Posted by Jay Hogan <se...@gmail.com>.
Chris,

I'm not that familiar with the inner workings of the API but based on the
description in the Javadoc, I think you are going to need to provide a
custom implementation of IMarkupCache.

If you are looking for a simpler solution, you could enter an RFE for new
property on iMarkupSettings that replicates the DEV mode markup reload
functionality.

Good luck,
Jay
On Thu, Feb 28, 2008 at 4:50 PM, Chris Colman <ch...@stepaheadsoftware.com>
wrote:

> The interesting thing is that a bounce of the app reads the new variants
> without a problem. This seems to indicate to me that there must be some
> initial 'markup discovery' operation when wicket starts up and only
> those markup files found during that discovery operation can be loaded,
> ever.
>
> It is interesting that in development mode changed markups will be
> detected and the latest markup will be used - this is a development mode
> feature we definitely need in production so that we can change markup
> without requiring an app bounce.
>
> If wicket can detect changed markup when in development mode there must
> be some 'flag' or 'switch' that we can turn on to tell wicket to detect
> new markup as well. How hard would this be to add?
>
> Is not looking for new markups a performance based design decision?
>
> It's not like wicket would have to poll the markup directories
> constantly - it only needs to check for the existence of a markup file
> when requested and only if it's not already found in the cache so a
> check of the file system would only occur the very first time a new page
> was requested because then it would not exist in the cache. Further
> requests would merely return the cached version. I would think that this
> would have negligible affect on performance.
>
>
>
> > -----Original Message-----
> > From: Jay Hogan [mailto:seeker136@gmail.com]
> > Sent: Friday, 29 February 2008 8:23 AM
> > To: users@wicket.apache.org
> > Subject: Re: Pickup up new markup without restarting webapp
> >
> > Chris,
> >
> > Have you looked at subclassing MarkupCache? I'm just a Wicket user so
> one
> > of
> > the devs might want to weigh in but that is where I would start
> looking.
> >
> >
> http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/marku
> p/<http://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/markup/>
> > MarkupCache.html
> >
> > Cheers,
> > Jay
> >
> > On Thu, Feb 28, 2008 at 4:01 PM, Chris Colman
> > <ch...@stepaheadsoftware.com>
> > wrote:
> >
> > > > Chris,
> > > >
> > > > Generating static markup files is not really the "Wicket way" of
> doing
> > > > things. Couldn't you just use multiple panels and dynamically
> > > add/replace
> > > > as needed ...create-dynamic-markup-hierarchies-using-panels.html?
> > >
> > > The scope of different markup we use involves massive changes to the
> > > whole page, not just a few panels so this solution won't work well
> for
> > > us.
> > >
> > > > Or maybe variations will work for you (see
> > > > http://cwiki.apache.org/WICKET/multiple-markups-per-page.html)?
> > >
> > > We do use variations - therein lies the problem: A new variation is
> > > generated to the file system by the web app but when wicket tries to
> > > render the page using that new variation the variation's markup will
> be
> > > ignored until after we bounce the web app.
> > >
> > > > If neither of these fits th bill, you could try using a
> > > > ReloadingWicketFilter:
> > > >
> > >
> >
> http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/proto<http://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/proto>
> <h
> >
> ttp://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/prot
> o>
> > > co
> > > > l/http/ReloadingWicketFilter.html
> > >
> > > Does this solution cause a reloading of the entire web app when a
> new
> > > markup is detected? If so, ouch! The markup files can be regenerated
> > > quite frequently and we can't afford to bounce the whole web app
> each
> > > time.
> > >
> > > Is there an interface used to provide the markup to wicket for which
> we
> > > can provide our own implementation and do the loading and caching of
> > > markup and checking for new markup ourselves?
> > >
> > > >
> > > > Cheers,
> > > > Jay
> > > > On Thu, Feb 28, 2008 at 2:40 PM, Chris Colman
> > > > <ch...@stepaheadsoftware.com>
> > > > wrote:
> > > >
> > > > > Is there a wicket mode I can configure in which new markup (eg.,
> new
> > > > > markup variations) can be picked up at run time without
> restarting
> > > the
> > > > > app?
> > > > >
> > > > > In our app we can create/generate new markup at runtime. We
> don't
> > > want
> > > > > to have to force a bounce of the web app for wicket to 'see'
> this
> > > new
> > > > > markup.
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > ============================================
> > > > Computer Science: solving today's problems tomorrow.
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
> >
> > --
> > ============================================
> > Computer Science: solving today's problems tomorrow.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
============================================
Computer Science: solving today's problems tomorrow.

RE: Pickup up new markup without restarting webapp

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
The interesting thing is that a bounce of the app reads the new variants
without a problem. This seems to indicate to me that there must be some
initial 'markup discovery' operation when wicket starts up and only
those markup files found during that discovery operation can be loaded,
ever.

It is interesting that in development mode changed markups will be
detected and the latest markup will be used - this is a development mode
feature we definitely need in production so that we can change markup
without requiring an app bounce.

If wicket can detect changed markup when in development mode there must
be some 'flag' or 'switch' that we can turn on to tell wicket to detect
new markup as well. How hard would this be to add?

Is not looking for new markups a performance based design decision?

It's not like wicket would have to poll the markup directories
constantly - it only needs to check for the existence of a markup file
when requested and only if it's not already found in the cache so a
check of the file system would only occur the very first time a new page
was requested because then it would not exist in the cache. Further
requests would merely return the cached version. I would think that this
would have negligible affect on performance.



> -----Original Message-----
> From: Jay Hogan [mailto:seeker136@gmail.com]
> Sent: Friday, 29 February 2008 8:23 AM
> To: users@wicket.apache.org
> Subject: Re: Pickup up new markup without restarting webapp
> 
> Chris,
> 
> Have you looked at subclassing MarkupCache? I'm just a Wicket user so
one
> of
> the devs might want to weigh in but that is where I would start
looking.
> 
>
http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/marku
p/
> MarkupCache.html
> 
> Cheers,
> Jay
> 
> On Thu, Feb 28, 2008 at 4:01 PM, Chris Colman
> <ch...@stepaheadsoftware.com>
> wrote:
> 
> > > Chris,
> > >
> > > Generating static markup files is not really the "Wicket way" of
doing
> > > things. Couldn't you just use multiple panels and dynamically
> > add/replace
> > > as needed ...create-dynamic-markup-hierarchies-using-panels.html?
> >
> > The scope of different markup we use involves massive changes to the
> > whole page, not just a few panels so this solution won't work well
for
> > us.
> >
> > > Or maybe variations will work for you (see
> > > http://cwiki.apache.org/WICKET/multiple-markups-per-page.html)?
> >
> > We do use variations - therein lies the problem: A new variation is
> > generated to the file system by the web app but when wicket tries to
> > render the page using that new variation the variation's markup will
be
> > ignored until after we bounce the web app.
> >
> > > If neither of these fits th bill, you could try using a
> > > ReloadingWicketFilter:
> > >
> >
>
http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/proto
<h
>
ttp://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/prot
o>
> > co
> > > l/http/ReloadingWicketFilter.html
> >
> > Does this solution cause a reloading of the entire web app when a
new
> > markup is detected? If so, ouch! The markup files can be regenerated
> > quite frequently and we can't afford to bounce the whole web app
each
> > time.
> >
> > Is there an interface used to provide the markup to wicket for which
we
> > can provide our own implementation and do the loading and caching of
> > markup and checking for new markup ourselves?
> >
> > >
> > > Cheers,
> > > Jay
> > > On Thu, Feb 28, 2008 at 2:40 PM, Chris Colman
> > > <ch...@stepaheadsoftware.com>
> > > wrote:
> > >
> > > > Is there a wicket mode I can configure in which new markup (eg.,
new
> > > > markup variations) can be picked up at run time without
restarting
> > the
> > > > app?
> > > >
> > > > In our app we can create/generate new markup at runtime. We
don't
> > want
> > > > to have to force a bounce of the web app for wicket to 'see'
this
> > new
> > > > markup.
> > > >
> > > >
> >
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > ============================================
> > > Computer Science: solving today's problems tomorrow.
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> 
> --
> ============================================
> Computer Science: solving today's problems tomorrow.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Pickup up new markup without restarting webapp

Posted by Jay Hogan <se...@gmail.com>.
Chris,

Wouldn't you need to completely replace the default MarkupCache with your
own implementation. Like this:

public class CustomApplication extends WebApplication {
...
   protected void init() {
      getMarkupSettings().setMarkupCache(new IMarkupCache() {
          [your implementation of markup cache]
         });
   }
}



On Thu, Feb 28, 2008 at 4:35 PM, Chris Colman <ch...@stepaheadsoftware.com>
wrote:

> I wonder which of the methods I need to override:
>
> protected  IMarkupLoader getMarkupLoader()
>          In case there is a need
>
> In my app I already override ResourceStreamLocator to tell wicket where
> to find the markup (as it can't be in the web app itself for our app).
>
> Are there any other methods in that class which would be appropriate for
> overriding?
>
> > Chris,
> >
> > Have you looked at subclassing MarkupCache? I'm just a Wicket user so
> one
> > of
> > the devs might want to weigh in but that is where I would start
> looking.
> >
> >
> http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/marku
> p/<http://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/markup/>
> > MarkupCache.html
> >
> > Cheers,
> > Jay
> >
> > On Thu, Feb 28, 2008 at 4:01 PM, Chris Colman
> > <ch...@stepaheadsoftware.com>
> > wrote:
> >
> > > > Chris,
> > > >
> > > > Generating static markup files is not really the "Wicket way" of
> doing
> > > > things. Couldn't you just use multiple panels and dynamically
> > > add/replace
> > > > as needed ...create-dynamic-markup-hierarchies-using-panels.html?
> > >
> > > The scope of different markup we use involves massive changes to the
> > > whole page, not just a few panels so this solution won't work well
> for
> > > us.
> > >
> > > > Or maybe variations will work for you (see
> > > > http://cwiki.apache.org/WICKET/multiple-markups-per-page.html)?
> > >
> > > We do use variations - therein lies the problem: A new variation is
> > > generated to the file system by the web app but when wicket tries to
> > > render the page using that new variation the variation's markup will
> be
> > > ignored until after we bounce the web app.
> > >
> > > > If neither of these fits th bill, you could try using a
> > > > ReloadingWicketFilter:
> > > >
> > >
> >
> http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/proto<http://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/proto>
> <h
> >
> ttp://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/prot
> o>
> > > co
> > > > l/http/ReloadingWicketFilter.html
> > >
> > > Does this solution cause a reloading of the entire web app when a
> new
> > > markup is detected? If so, ouch! The markup files can be regenerated
> > > quite frequently and we can't afford to bounce the whole web app
> each
> > > time.
> > >
> > > Is there an interface used to provide the markup to wicket for which
> we
> > > can provide our own implementation and do the loading and caching of
> > > markup and checking for new markup ourselves?
> > >
> > > >
> > > > Cheers,
> > > > Jay
> > > > On Thu, Feb 28, 2008 at 2:40 PM, Chris Colman
> > > > <ch...@stepaheadsoftware.com>
> > > > wrote:
> > > >
> > > > > Is there a wicket mode I can configure in which new markup (eg.,
> new
> > > > > markup variations) can be picked up at run time without
> restarting
> > > the
> > > > > app?
> > > > >
> > > > > In our app we can create/generate new markup at runtime. We
> don't
> > > want
> > > > > to have to force a bounce of the web app for wicket to 'see'
> this
> > > new
> > > > > markup.
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > ============================================
> > > > Computer Science: solving today's problems tomorrow.
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
> >
> > --
> > ============================================
> > Computer Science: solving today's problems tomorrow.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
============================================
Computer Science: solving today's problems tomorrow.

RE: Pickup up new markup without restarting webapp

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
I wonder which of the methods I need to override:

protected  IMarkupLoader getMarkupLoader() 
          In case there is a need  

In my app I already override ResourceStreamLocator to tell wicket where
to find the markup (as it can't be in the web app itself for our app).

Are there any other methods in that class which would be appropriate for
overriding? 

> Chris,
> 
> Have you looked at subclassing MarkupCache? I'm just a Wicket user so
one
> of
> the devs might want to weigh in but that is where I would start
looking.
> 
>
http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/marku
p/
> MarkupCache.html
> 
> Cheers,
> Jay
> 
> On Thu, Feb 28, 2008 at 4:01 PM, Chris Colman
> <ch...@stepaheadsoftware.com>
> wrote:
> 
> > > Chris,
> > >
> > > Generating static markup files is not really the "Wicket way" of
doing
> > > things. Couldn't you just use multiple panels and dynamically
> > add/replace
> > > as needed ...create-dynamic-markup-hierarchies-using-panels.html?
> >
> > The scope of different markup we use involves massive changes to the
> > whole page, not just a few panels so this solution won't work well
for
> > us.
> >
> > > Or maybe variations will work for you (see
> > > http://cwiki.apache.org/WICKET/multiple-markups-per-page.html)?
> >
> > We do use variations - therein lies the problem: A new variation is
> > generated to the file system by the web app but when wicket tries to
> > render the page using that new variation the variation's markup will
be
> > ignored until after we bounce the web app.
> >
> > > If neither of these fits th bill, you could try using a
> > > ReloadingWicketFilter:
> > >
> >
>
http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/proto
<h
>
ttp://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/prot
o>
> > co
> > > l/http/ReloadingWicketFilter.html
> >
> > Does this solution cause a reloading of the entire web app when a
new
> > markup is detected? If so, ouch! The markup files can be regenerated
> > quite frequently and we can't afford to bounce the whole web app
each
> > time.
> >
> > Is there an interface used to provide the markup to wicket for which
we
> > can provide our own implementation and do the loading and caching of
> > markup and checking for new markup ourselves?
> >
> > >
> > > Cheers,
> > > Jay
> > > On Thu, Feb 28, 2008 at 2:40 PM, Chris Colman
> > > <ch...@stepaheadsoftware.com>
> > > wrote:
> > >
> > > > Is there a wicket mode I can configure in which new markup (eg.,
new
> > > > markup variations) can be picked up at run time without
restarting
> > the
> > > > app?
> > > >
> > > > In our app we can create/generate new markup at runtime. We
don't
> > want
> > > > to have to force a bounce of the web app for wicket to 'see'
this
> > new
> > > > markup.
> > > >
> > > >
> >
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > ============================================
> > > Computer Science: solving today's problems tomorrow.
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> 
> --
> ============================================
> Computer Science: solving today's problems tomorrow.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Pickup up new markup without restarting webapp

Posted by Jay Hogan <se...@gmail.com>.
Chris,

Have you looked at subclassing MarkupCache? I'm just a Wicket user so one of
the devs might want to weigh in but that is where I would start looking.

http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/markup/MarkupCache.html

Cheers,
Jay

On Thu, Feb 28, 2008 at 4:01 PM, Chris Colman <ch...@stepaheadsoftware.com>
wrote:

> > Chris,
> >
> > Generating static markup files is not really the "Wicket way" of doing
> > things. Couldn't you just use multiple panels and dynamically
> add/replace
> > as needed ...create-dynamic-markup-hierarchies-using-panels.html?
>
> The scope of different markup we use involves massive changes to the
> whole page, not just a few panels so this solution won't work well for
> us.
>
> > Or maybe variations will work for you (see
> > http://cwiki.apache.org/WICKET/multiple-markups-per-page.html)?
>
> We do use variations - therein lies the problem: A new variation is
> generated to the file system by the web app but when wicket tries to
> render the page using that new variation the variation's markup will be
> ignored until after we bounce the web app.
>
> > If neither of these fits th bill, you could try using a
> > ReloadingWicketFilter:
> >
> http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/proto<http://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/proto>
> co
> > l/http/ReloadingWicketFilter.html
>
> Does this solution cause a reloading of the entire web app when a new
> markup is detected? If so, ouch! The markup files can be regenerated
> quite frequently and we can't afford to bounce the whole web app each
> time.
>
> Is there an interface used to provide the markup to wicket for which we
> can provide our own implementation and do the loading and caching of
> markup and checking for new markup ourselves?
>
> >
> > Cheers,
> > Jay
> > On Thu, Feb 28, 2008 at 2:40 PM, Chris Colman
> > <ch...@stepaheadsoftware.com>
> > wrote:
> >
> > > Is there a wicket mode I can configure in which new markup (eg., new
> > > markup variations) can be picked up at run time without restarting
> the
> > > app?
> > >
> > > In our app we can create/generate new markup at runtime. We don't
> want
> > > to have to force a bounce of the web app for wicket to 'see' this
> new
> > > markup.
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
> >
> > --
> > ============================================
> > Computer Science: solving today's problems tomorrow.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
============================================
Computer Science: solving today's problems tomorrow.

RE: Pickup up new markup without restarting webapp

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
> Chris,
> 
> Generating static markup files is not really the "Wicket way" of doing
> things. Couldn't you just use multiple panels and dynamically
add/replace
> as needed ...create-dynamic-markup-hierarchies-using-panels.html?

The scope of different markup we use involves massive changes to the
whole page, not just a few panels so this solution won't work well for
us.

> Or maybe variations will work for you (see
> http://cwiki.apache.org/WICKET/multiple-markups-per-page.html)?

We do use variations - therein lies the problem: A new variation is
generated to the file system by the web app but when wicket tries to
render the page using that new variation the variation's markup will be
ignored until after we bounce the web app.

> If neither of these fits th bill, you could try using a
> ReloadingWicketFilter:
>
http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/proto
co
> l/http/ReloadingWicketFilter.html

Does this solution cause a reloading of the entire web app when a new
markup is detected? If so, ouch! The markup files can be regenerated
quite frequently and we can't afford to bounce the whole web app each
time.

Is there an interface used to provide the markup to wicket for which we
can provide our own implementation and do the loading and caching of
markup and checking for new markup ourselves?

> 
> Cheers,
> Jay
> On Thu, Feb 28, 2008 at 2:40 PM, Chris Colman
> <ch...@stepaheadsoftware.com>
> wrote:
> 
> > Is there a wicket mode I can configure in which new markup (eg., new
> > markup variations) can be picked up at run time without restarting
the
> > app?
> >
> > In our app we can create/generate new markup at runtime. We don't
want
> > to have to force a bounce of the web app for wicket to 'see' this
new
> > markup.
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> 
> --
> ============================================
> Computer Science: solving today's problems tomorrow.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Pickup up new markup without restarting webapp

Posted by Jay Hogan <se...@gmail.com>.
Chris,

Generating static markup files is not really the "Wicket way" of doing
things. Couldn't you just use multiple panels and dynamically add/replace as
needed (see
http://cwiki.apache.org/WICKET/create-dynamic-markup-hierarchies-using-panels.html)?
Or maybe variations will work for you (see
http://cwiki.apache.org/WICKET/multiple-markups-per-page.html)?

If neither of these fits th bill, you could try using a
ReloadingWicketFilter:
http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/protocol/http/ReloadingWicketFilter.html

Cheers,
Jay
On Thu, Feb 28, 2008 at 2:40 PM, Chris Colman <ch...@stepaheadsoftware.com>
wrote:

> Is there a wicket mode I can configure in which new markup (eg., new
> markup variations) can be picked up at run time without restarting the
> app?
>
> In our app we can create/generate new markup at runtime. We don't want
> to have to force a bounce of the web app for wicket to 'see' this new
> markup.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
============================================
Computer Science: solving today's problems tomorrow.

Re: Multiple bookmarks to same page class - possible?

Posted by Igor Vaynberg <ig...@gmail.com>.
On Thu, Feb 28, 2008 at 12:07 PM, Chris Colman
<ch...@stepaheadsoftware.com> wrote:
> Is it possible to route multiple bookmarks using mountBookmarkablePage
>  to the same page class?

i dont see a problem with mounting the same page class multiple times

>
>  Also, is it possible for the page to ask what it's bookmark (or URL) is?

requestcycle.urlfor(pageclass);

-igor


>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>  For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Multiple bookmarks to same page class - possible?

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
Is it possible to route multiple bookmarks using mountBookmarkablePage
to the same page class?

Also, is it possible for the page to ask what it's bookmark (or URL) is?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Pickup up new markup without restarting webapp

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
Is there a wicket mode I can configure in which new markup (eg., new
markup variations) can be picked up at run time without restarting the
app?

In our app we can create/generate new markup at runtime. We don't want
to have to force a bounce of the web app for wicket to 'see' this new
markup.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: n^2 loop in MarkupContainer?

Posted by Meetesh Karia <me...@gmail.com>.
I wanted to follow up on this now that I had a chance to put a profiler 
to this.  It turns out that the problem was actually coming from calls 
to TextTemplateHeaderContributor.forJavaScript which has TODOs for the 
implementation of caching.  I worked around the problem by creating the 
PackagedTextTemplate once and reusing it.

Thanks and sorry for the thread of emails,
Meetesh

Timo Rantalaiho wrote:
> Hello all,
>
> Such optimisation should be preceeded by getting hard 
> profiling data, right? 
>
> We have some repeaters that get hundreds of Items and the
> part of adding child components has not shown up as a
> bottleneck when profiling.
>
> It has made us think, though, whether it makes sense to 
> output hundreds of rows of data on the screen anyway :)
>
> Best wishes,
> Timo
>
>   

Re: n^2 loop in MarkupContainer?

Posted by Timo Rantalaiho <Ti...@ri.fi>.
Hello all,

Such optimisation should be preceeded by getting hard 
profiling data, right? 

We have some repeaters that get hundreds of Items and the
part of adding child components has not shown up as a
bottleneck when profiling.

It has made us think, though, whether it makes sense to 
output hundreds of rows of data on the screen anyway :)

Best wishes,
Timo

-- 
Timo Rantalaiho           
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: n^2 loop in MarkupContainer?

Posted by Johan Compagner <jc...@gmail.com>.
no don't introduce a transient field for that. (its not serialized but in
memory its an extra slot)
We could that by using the same field and compress it in detach.

The problem i also see is that we then have to have a count, how much is
already filled, or walk over it to find the first null in the array...(see *
private* *final* *int* children_size())

On Feb 11, 2008 2:56 PM, Al Maw <wi...@almaw.com> wrote:

> 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
>  <ni...@jayway.dk> 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 <me...@gmail.com>
> 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: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: n^2 loop in MarkupContainer?

Posted by Al Maw <wi...@almaw.com>.
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
<ni...@jayway.dk> 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 <me...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: n^2 loop in MarkupContainer?

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
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 <me...@gmail.com> 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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: n^2 loop in MarkupContainer?

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
I've seen this drop in performance too... and with over 2000 items, it 
was very slow.. I fixed it by using something similar to a 
loadabledetachable model.. (turned out that it used the dao on each 
render of an item).. So might not be the same..

regards Nino

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 <me...@gmail.com> 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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: n^2 loop in MarkupContainer?

Posted by Meetesh Karia <me...@gmail.com>.
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 <me...@gmail.com> 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
>>
>>     
>
>
>
>   

Re: n^2 loop in MarkupContainer?

Posted by Matej Knopp <ma...@gmail.com>.
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 <me...@gmail.com> 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
>



-- 
Resizable and reorderable grid components.
http://www.inmethod.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org