Re: Help me speed up my Wicket
On Thu, May 20, 2010 at 12:28 PM, Edward Zarecor wrote: > Rewinding this thread. Comments and suggestion in-line. > > > > The problem is that it renders very slowly in browsers. > > > > The reason is not directly network speed but it is the VERY heavy > > markup. Each table cell has 3 ajax components and the ajax call > > functions are loong. > > > > > So you're doing ~60 network round trips for the calender component alone, > if > I understand correctly, and you don't think the issue is network related. > I > find that hard to believe. If you disable JavaScript in your browser or > use > some other method for preventing the Ajax from executing, does it still > render slowly -- assuming it will render at all with Ajax disabled. > In his original post he showed the HTML - what he means is the rendering of very long *strings* that represent the ajax onchange events. Not that they're each triggered when the page loads. -- Jeremy Thomerson http://www.wickettraining.com
Re: Help me speed up my Wicket
Hi! > So you're doing ~60 network round trips for the calender component alone, if > I understand correctly, No, that's not it, you have misunderstood. No roundtrips. Just single pageload. Ajax events occur only if user clicks on components, but that is not the issue. The issue is the heavy markup that is loaded on the single pageload. >> I think you should pre-compute the initial state of your calender on page > load, all the work done in ~1 round trip, and use Ajax to handle changes > that must be reflected dynamically. Maybe I don't understand your use case > well enough, is there some reason you could not do what I suggest? This is already done. That is not the issue. The issue is LOADING the markup. Plain html with javascript content. The issue is not executing the javascript. Only rendering it is an issue, beacuse it is so heavy. Look at the first post there is an excerpt of the heavy markup. ** Martin > > > Ed. > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Help me speed up my Wicket
Rewinding this thread. Comments and suggestion in-line. > The problem is that it renders very slowly in browsers. > > The reason is not directly network speed but it is the VERY heavy > markup. Each table cell has 3 ajax components and the ajax call > functions are loong. > > So you're doing ~60 network round trips for the calender component alone, if I understand correctly, and you don't think the issue is network related. I find that hard to believe. If you disable JavaScript in your browser or use some other method for preventing the Ajax from executing, does it still render slowly -- assuming it will render at all with Ajax disabled. > I have tested to strip away all ajax calls and it renders pretty OK. > Now what I am thinking is that is there a way to shorten the wicket > ajax call urls? > > > Note that stripping away the Ajax calls strips away the round trips, not just the mark up. I believe the round trips are the real issue. > > Any practical suggestions? > > > I think you should pre-compute the initial state of your calender on page load, all the work done in ~1 round trip, and use Ajax to handle changes that must be reflected dynamically. Maybe I don't understand your use case well enough, is there some reason you could not do what I suggest? Ed.
Re: Help me speed up my Wicket
Well not true in this case, because it's the rendering itself that are slow not the transfer. But true it will add a overhead to page load transfer time and if latency are bad it would be even worse. 2010/5/20 Matthias Keller : > And it would not speed up page loading at all since in the end, the same > data would have to be transferred but splitted into multiple requests which > adds the request overhead to the total loading time compared to the prepared > complete page. > > On 2010-05-20 10:25, Martin Makundi wrote: >> >> Would this not flicker a lot? >> >> ** >> Martin >> >> 2010/5/20 nino martinez wael: >> >>> >>> ok the idea are this: >>> >>> First render the page with out the grid. >>> Then add the empty grid >>> Then add row 1 to grid >>> Adding row 1 triggers a new request adding row 2 and so on until all >>> rows are loaded.. >>> >>> All done with ajax. >>> >>> It's just an idea, but I think it should help. However it causes more >>> load on the server I think. >>> >>> 2010/5/20 Martin Makundi: >>> > > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Help me speed up my Wicket
Depends on how you do it, but if you always know the height then no, the rows would just appear.. You could use a ajax indicator to tell the user that the page are loading. 2010/5/20 Martin Makundi : > Would this not flicker a lot? > > ** > Martin > > 2010/5/20 nino martinez wael : >> ok the idea are this: >> >> First render the page with out the grid. >> Then add the empty grid >> Then add row 1 to grid >> Adding row 1 triggers a new request adding row 2 and so on until all >> rows are loaded.. >> >> All done with ajax. >> >> It's just an idea, but I think it should help. However it causes more >> load on the server I think. >> >> 2010/5/20 Martin Makundi : >>> Yes.. what you mean cascade load? >>> >>> ** >>> Martin >>> >>> 2010/5/20 nino martinez wael : No havent had the problem myself. But I guess you should start by loading the page without the listview enabled, and then add the listview afterwards and see if that helps. Next step would be to cascade load the rows... 2010/5/19 Martin Makundi : > Hmm.. can you show me an example of something like that, how is it done? > > ** > Martin > > 2010/5/19 nino martinez wael : >> about the lazyloading, I was thinking to cascade load the rows after >> page render, it should perform better in theory:)... >> >> 2010/5/19 Martin Makundi : >>> Hi! >>> hmm could'nt just use a custom ajax decorator? Or override the js part of the onchangeajaxbehaviour? >>> >>> Hmm.. sounds like a good starting point... thanks. >>> >>> BTW: I totally lost you on that lazy loading thing... the user would >>> like the page to load in a snap and using it to be like a snap. How >>> would your proposed lazy loading be implemented? >>> >>> ** >>> Martin 2010/5/19 Jeremy Thomerson : > Well, if the rendering of all that extra JS is what's causing the > problem, > I'd try to limit it to one rendering of the (slightly-modified) > behavior. > > You can basically render something like this: > > function somethingInMyTableChanged(rowInd) { > return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd); > } > > Then, you add a simple behavior to your row items like: > > new SimpleAttributeModifier("onchange", true, new > Model("return > somethingInMyTableChanged(" + item.getRowIndex() + ");"); > > In your behavior, now you have to do a little extra work (don't use an > onchangeajaxbehavior, just use a custom defaultajaxbehavior or > something > like that). You'll need to call > RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex") > and use that to see which row changed. > > Anyway, it should work, but it's a little less "clean" than you > normally > would do in Wicket. BUT - if you have proven that it's the rendering > of all > that extra AJAX string stuff that's slowing you down, then it's worth > doing. > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > On Wed, May 19, 2010 at 11:09 AM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> Hi! >> >> Yes.. my question now is: how to easily extract the JS? It is from >> onchangeajaxbehavior etc. >> >> I would like to continue using wicket standard onchangeajaxbehavior >> but somehow override the way it injects the js into the component >> tag. >> Suggestions to accomplish this? >> >> ** >> Martin >> >> 2010/5/19 Jeremy Thomerson : >> > If you've already proven that removing the AJAX removes the >> > contention, >> I'd >> > go with Nino's "otherwise" route. That was my first guess. >> > Depending on >> > what you're doing with those AJAX calls, you could probably make >> > it so >> that >> > you have one to three of them for the entire table, wrapped in a >> > custom >> > function. (You don't have to extract them to a separate JS). >> > Then each >> row >> > would shorten it's JavaScript output to >> > myCustomFunction(rowIndex). If >> you >> > need some help, let us know. I posted a message on this list a >> > week or >> so >> > ago showing how to wrap existing AJAX in a custom function. That >> > might >> > help, too. >> > >> > -- >> > Jeremy Thomerson >> > http://www.wickettraining.com >> > >> > >> > >> > On Wed, May 19, 2010 at 10:51 AM, nino mart
Re: Help me speed up my Wicket
Hi. W dniu 2010-05-20 10:28, Matthias Keller pisze: And it would not speed up page loading at all since in the end, the same data would have to be transferred but splitted into multiple requests which adds the request overhead to the total loading time compared to the prepared complete page. It depends. If the most important thing is too show some particalur component to customer (for e.g news) and rest of page can be load lazy it will speed it up. Since the most important component will be shown fast rest of page will be rendered as empty panels. On 2010-05-20 10:25, Martin Makundi wrote: Would this not flicker a lot? It flicker, but not a lot :) AjaxLazyLoadPanel ** Martin 2010/5/20 nino martinez wael: ok the idea are this: First render the page with out the grid. Then add the empty grid Then add row 1 to grid Adding row 1 triggers a new request adding row 2 and so on until all rows are loaded.. All done with ajax. It's just an idea, but I think it should help. However it causes more load on the server I think. 2010/5/20 Martin Makundi: - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Help me speed up my Wicket
And it would not speed up page loading at all since in the end, the same data would have to be transferred but splitted into multiple requests which adds the request overhead to the total loading time compared to the prepared complete page. On 2010-05-20 10:25, Martin Makundi wrote: Would this not flicker a lot? ** Martin 2010/5/20 nino martinez wael: ok the idea are this: First render the page with out the grid. Then add the empty grid Then add row 1 to grid Adding row 1 triggers a new request adding row 2 and so on until all rows are loaded.. All done with ajax. It's just an idea, but I think it should help. However it causes more load on the server I think. 2010/5/20 Martin Makundi: smime.p7s Description: S/MIME Cryptographic Signature
Re: Help me speed up my Wicket
Would this not flicker a lot? ** Martin 2010/5/20 nino martinez wael : > ok the idea are this: > > First render the page with out the grid. > Then add the empty grid > Then add row 1 to grid > Adding row 1 triggers a new request adding row 2 and so on until all > rows are loaded.. > > All done with ajax. > > It's just an idea, but I think it should help. However it causes more > load on the server I think. > > 2010/5/20 Martin Makundi : >> Yes.. what you mean cascade load? >> >> ** >> Martin >> >> 2010/5/20 nino martinez wael : >>> No havent had the problem myself. But I guess you should start by >>> loading the page without the listview enabled, and then add the >>> listview afterwards and see if that helps. Next step would be to >>> cascade load the rows... >>> >>> 2010/5/19 Martin Makundi : Hmm.. can you show me an example of something like that, how is it done? ** Martin 2010/5/19 nino martinez wael : > about the lazyloading, I was thinking to cascade load the rows after > page render, it should perform better in theory:)... > > 2010/5/19 Martin Makundi : >> Hi! >> >>> hmm could'nt just use a custom ajax decorator? Or override the js part >>> of the onchangeajaxbehaviour? >> >> Hmm.. sounds like a good starting point... thanks. >> >> BTW: I totally lost you on that lazy loading thing... the user would >> like the page to load in a snap and using it to be like a snap. How >> would your proposed lazy loading be implemented? >> >> ** >> Martin >>> >>> 2010/5/19 Jeremy Thomerson : Well, if the rendering of all that extra JS is what's causing the problem, I'd try to limit it to one rendering of the (slightly-modified) behavior. You can basically render something like this: function somethingInMyTableChanged(rowInd) { return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd); } Then, you add a simple behavior to your row items like: new SimpleAttributeModifier("onchange", true, new Model("return somethingInMyTableChanged(" + item.getRowIndex() + ");"); In your behavior, now you have to do a little extra work (don't use an onchangeajaxbehavior, just use a custom defaultajaxbehavior or something like that). You'll need to call RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex") and use that to see which row changed. Anyway, it should work, but it's a little less "clean" than you normally would do in Wicket. BUT - if you have proven that it's the rendering of all that extra AJAX string stuff that's slowing you down, then it's worth doing. -- Jeremy Thomerson http://www.wickettraining.com On Wed, May 19, 2010 at 11:09 AM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > Hi! > > Yes.. my question now is: how to easily extract the JS? It is from > onchangeajaxbehavior etc. > > I would like to continue using wicket standard onchangeajaxbehavior > but somehow override the way it injects the js into the component tag. > Suggestions to accomplish this? > > ** > Martin > > 2010/5/19 Jeremy Thomerson : > > If you've already proven that removing the AJAX removes the > > contention, > I'd > > go with Nino's "otherwise" route. That was my first guess. > > Depending on > > what you're doing with those AJAX calls, you could probably make it > > so > that > > you have one to three of them for the entire table, wrapped in a > > custom > > function. (You don't have to extract them to a separate JS). Then > > each > row > > would shorten it's JavaScript output to myCustomFunction(rowIndex). > > If > you > > need some help, let us know. I posted a message on this list a > > week or > so > > ago showing how to wrap existing AJAX in a custom function. That > > might > > help, too. > > > > -- > > Jeremy Thomerson > > http://www.wickettraining.com > > > > > > > > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael < > > nino.martinez.w...@gmail.com> wrote: > > > >> The easiest thing would probably to lazy load the rows somehow, how > >> are load time pr row?.. Otherwise you could extract the long inline > >> code into a seperate js and wrap them into induvidual methods, > >> although I do not know if it makes page loa
Re: Help me speed up my Wicket
ok the idea are this: First render the page with out the grid. Then add the empty grid Then add row 1 to grid Adding row 1 triggers a new request adding row 2 and so on until all rows are loaded.. All done with ajax. It's just an idea, but I think it should help. However it causes more load on the server I think. 2010/5/20 Martin Makundi : > Yes.. what you mean cascade load? > > ** > Martin > > 2010/5/20 nino martinez wael : >> No havent had the problem myself. But I guess you should start by >> loading the page without the listview enabled, and then add the >> listview afterwards and see if that helps. Next step would be to >> cascade load the rows... >> >> 2010/5/19 Martin Makundi : >>> Hmm.. can you show me an example of something like that, how is it done? >>> >>> ** >>> Martin >>> >>> 2010/5/19 nino martinez wael : about the lazyloading, I was thinking to cascade load the rows after page render, it should perform better in theory:)... 2010/5/19 Martin Makundi : > Hi! > >> hmm could'nt just use a custom ajax decorator? Or override the js part >> of the onchangeajaxbehaviour? > > Hmm.. sounds like a good starting point... thanks. > > BTW: I totally lost you on that lazy loading thing... the user would > like the page to load in a snap and using it to be like a snap. How > would your proposed lazy loading be implemented? > > ** > Martin >> >> 2010/5/19 Jeremy Thomerson : >>> Well, if the rendering of all that extra JS is what's causing the >>> problem, >>> I'd try to limit it to one rendering of the (slightly-modified) >>> behavior. >>> >>> You can basically render something like this: >>> >>> function somethingInMyTableChanged(rowInd) { >>> return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd); >>> } >>> >>> Then, you add a simple behavior to your row items like: >>> >>> new SimpleAttributeModifier("onchange", true, new Model("return >>> somethingInMyTableChanged(" + item.getRowIndex() + ");"); >>> >>> In your behavior, now you have to do a little extra work (don't use an >>> onchangeajaxbehavior, just use a custom defaultajaxbehavior or something >>> like that). You'll need to call >>> RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex") >>> and use that to see which row changed. >>> >>> Anyway, it should work, but it's a little less "clean" than you normally >>> would do in Wicket. BUT - if you have proven that it's the rendering >>> of all >>> that extra AJAX string stuff that's slowing you down, then it's worth >>> doing. >>> >>> -- >>> Jeremy Thomerson >>> http://www.wickettraining.com >>> >>> >>> >>> On Wed, May 19, 2010 at 11:09 AM, Martin Makundi < >>> martin.maku...@koodaripalvelut.com> wrote: >>> Hi! Yes.. my question now is: how to easily extract the JS? It is from onchangeajaxbehavior etc. I would like to continue using wicket standard onchangeajaxbehavior but somehow override the way it injects the js into the component tag. Suggestions to accomplish this? ** Martin 2010/5/19 Jeremy Thomerson : > If you've already proven that removing the AJAX removes the > contention, I'd > go with Nino's "otherwise" route. That was my first guess. > Depending on > what you're doing with those AJAX calls, you could probably make it > so that > you have one to three of them for the entire table, wrapped in a > custom > function. (You don't have to extract them to a separate JS). Then > each row > would shorten it's JavaScript output to myCustomFunction(rowIndex). > If you > need some help, let us know. I posted a message on this list a week > or so > ago showing how to wrap existing AJAX in a custom function. That > might > help, too. > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael < > nino.martinez.w...@gmail.com> wrote: > >> The easiest thing would probably to lazy load the rows somehow, how >> are load time pr row?.. Otherwise you could extract the long inline >> code into a seperate js and wrap them into induvidual methods, >> although I do not know if it makes page load faster or there could >> be >> other issues. >> >> 2010/5/19 Martin Makundi : >> > Hi! >> > >> > HELP! >> > >> > I have a problem. I have a table with 20 co
Re: Help me speed up my Wicket
Yes.. what you mean cascade load? ** Martin 2010/5/20 nino martinez wael : > No havent had the problem myself. But I guess you should start by > loading the page without the listview enabled, and then add the > listview afterwards and see if that helps. Next step would be to > cascade load the rows... > > 2010/5/19 Martin Makundi : >> Hmm.. can you show me an example of something like that, how is it done? >> >> ** >> Martin >> >> 2010/5/19 nino martinez wael : >>> about the lazyloading, I was thinking to cascade load the rows after >>> page render, it should perform better in theory:)... >>> >>> 2010/5/19 Martin Makundi : Hi! > hmm could'nt just use a custom ajax decorator? Or override the js part > of the onchangeajaxbehaviour? Hmm.. sounds like a good starting point... thanks. BTW: I totally lost you on that lazy loading thing... the user would like the page to load in a snap and using it to be like a snap. How would your proposed lazy loading be implemented? ** Martin > > 2010/5/19 Jeremy Thomerson : >> Well, if the rendering of all that extra JS is what's causing the >> problem, >> I'd try to limit it to one rendering of the (slightly-modified) behavior. >> >> You can basically render something like this: >> >> function somethingInMyTableChanged(rowInd) { >> return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd); >> } >> >> Then, you add a simple behavior to your row items like: >> >> new SimpleAttributeModifier("onchange", true, new Model("return >> somethingInMyTableChanged(" + item.getRowIndex() + ");"); >> >> In your behavior, now you have to do a little extra work (don't use an >> onchangeajaxbehavior, just use a custom defaultajaxbehavior or something >> like that). You'll need to call >> RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex") >> and use that to see which row changed. >> >> Anyway, it should work, but it's a little less "clean" than you normally >> would do in Wicket. BUT - if you have proven that it's the rendering of >> all >> that extra AJAX string stuff that's slowing you down, then it's worth >> doing. >> >> -- >> Jeremy Thomerson >> http://www.wickettraining.com >> >> >> >> On Wed, May 19, 2010 at 11:09 AM, Martin Makundi < >> martin.maku...@koodaripalvelut.com> wrote: >> >>> Hi! >>> >>> Yes.. my question now is: how to easily extract the JS? It is from >>> onchangeajaxbehavior etc. >>> >>> I would like to continue using wicket standard onchangeajaxbehavior >>> but somehow override the way it injects the js into the component tag. >>> Suggestions to accomplish this? >>> >>> ** >>> Martin >>> >>> 2010/5/19 Jeremy Thomerson : >>> > If you've already proven that removing the AJAX removes the >>> > contention, >>> I'd >>> > go with Nino's "otherwise" route. That was my first guess. >>> > Depending on >>> > what you're doing with those AJAX calls, you could probably make it so >>> that >>> > you have one to three of them for the entire table, wrapped in a >>> > custom >>> > function. (You don't have to extract them to a separate JS). Then >>> > each >>> row >>> > would shorten it's JavaScript output to myCustomFunction(rowIndex). >>> > If >>> you >>> > need some help, let us know. I posted a message on this list a week >>> > or >>> so >>> > ago showing how to wrap existing AJAX in a custom function. That >>> > might >>> > help, too. >>> > >>> > -- >>> > Jeremy Thomerson >>> > http://www.wickettraining.com >>> > >>> > >>> > >>> > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael < >>> > nino.martinez.w...@gmail.com> wrote: >>> > >>> >> The easiest thing would probably to lazy load the rows somehow, how >>> >> are load time pr row?.. Otherwise you could extract the long inline >>> >> code into a seperate js and wrap them into induvidual methods, >>> >> although I do not know if it makes page load faster or there could be >>> >> other issues. >>> >> >>> >> 2010/5/19 Martin Makundi : >>> >> > Hi! >>> >> > >>> >> > HELP! >>> >> > >>> >> > I have a problem. I have a table with 20 columns and 30 rows >>> >> ("calendar"). >>> >> > >>> >> > The problem is that it renders very slowly in browsers. >>> >> > >>> >> > The reason is not directly network speed but it is the VERY heavy >>> >> > markup. Each table cell has 3 ajax components and the ajax call >>> >> > functions are loong. >>> >> > >>> >> > I have tested to strip away all ajax calls and it renders pretty >>> >> > OK. >>> >> > Now what I am thinking is that is there a way to shorte
Re: Help me speed up my Wicket
No havent had the problem myself. But I guess you should start by loading the page without the listview enabled, and then add the listview afterwards and see if that helps. Next step would be to cascade load the rows... 2010/5/19 Martin Makundi : > Hmm.. can you show me an example of something like that, how is it done? > > ** > Martin > > 2010/5/19 nino martinez wael : >> about the lazyloading, I was thinking to cascade load the rows after >> page render, it should perform better in theory:)... >> >> 2010/5/19 Martin Makundi : >>> Hi! >>> hmm could'nt just use a custom ajax decorator? Or override the js part of the onchangeajaxbehaviour? >>> >>> Hmm.. sounds like a good starting point... thanks. >>> >>> BTW: I totally lost you on that lazy loading thing... the user would >>> like the page to load in a snap and using it to be like a snap. How >>> would your proposed lazy loading be implemented? >>> >>> ** >>> Martin 2010/5/19 Jeremy Thomerson : > Well, if the rendering of all that extra JS is what's causing the problem, > I'd try to limit it to one rendering of the (slightly-modified) behavior. > > You can basically render something like this: > > function somethingInMyTableChanged(rowInd) { > return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd); > } > > Then, you add a simple behavior to your row items like: > > new SimpleAttributeModifier("onchange", true, new Model("return > somethingInMyTableChanged(" + item.getRowIndex() + ");"); > > In your behavior, now you have to do a little extra work (don't use an > onchangeajaxbehavior, just use a custom defaultajaxbehavior or something > like that). You'll need to call > RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex") > and use that to see which row changed. > > Anyway, it should work, but it's a little less "clean" than you normally > would do in Wicket. BUT - if you have proven that it's the rendering of > all > that extra AJAX string stuff that's slowing you down, then it's worth > doing. > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > On Wed, May 19, 2010 at 11:09 AM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> Hi! >> >> Yes.. my question now is: how to easily extract the JS? It is from >> onchangeajaxbehavior etc. >> >> I would like to continue using wicket standard onchangeajaxbehavior >> but somehow override the way it injects the js into the component tag. >> Suggestions to accomplish this? >> >> ** >> Martin >> >> 2010/5/19 Jeremy Thomerson : >> > If you've already proven that removing the AJAX removes the contention, >> I'd >> > go with Nino's "otherwise" route. That was my first guess. Depending >> > on >> > what you're doing with those AJAX calls, you could probably make it so >> that >> > you have one to three of them for the entire table, wrapped in a custom >> > function. (You don't have to extract them to a separate JS). Then >> > each >> row >> > would shorten it's JavaScript output to myCustomFunction(rowIndex). If >> you >> > need some help, let us know. I posted a message on this list a week or >> so >> > ago showing how to wrap existing AJAX in a custom function. That might >> > help, too. >> > >> > -- >> > Jeremy Thomerson >> > http://www.wickettraining.com >> > >> > >> > >> > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael < >> > nino.martinez.w...@gmail.com> wrote: >> > >> >> The easiest thing would probably to lazy load the rows somehow, how >> >> are load time pr row?.. Otherwise you could extract the long inline >> >> code into a seperate js and wrap them into induvidual methods, >> >> although I do not know if it makes page load faster or there could be >> >> other issues. >> >> >> >> 2010/5/19 Martin Makundi : >> >> > Hi! >> >> > >> >> > HELP! >> >> > >> >> > I have a problem. I have a table with 20 columns and 30 rows >> >> ("calendar"). >> >> > >> >> > The problem is that it renders very slowly in browsers. >> >> > >> >> > The reason is not directly network speed but it is the VERY heavy >> >> > markup. Each table cell has 3 ajax components and the ajax call >> >> > functions are loong. >> >> > >> >> > I have tested to strip away all ajax calls and it renders pretty OK. >> >> > Now what I am thinking is that is there a way to shorten the wicket >> >> > ajax call urls? >> >> > >> >> > Any practical suggestions? I tried also shortening the wicket-id >> >> > names >> >> > but there still remains quite some blob of excess markup that could >> >> > brobably be in some reusable function?? >
Re: Help me speed up my Wicket
Hmm.. can you show me an example of something like that, how is it done? ** Martin 2010/5/19 nino martinez wael : > about the lazyloading, I was thinking to cascade load the rows after > page render, it should perform better in theory:)... > > 2010/5/19 Martin Makundi : >> Hi! >> >>> hmm could'nt just use a custom ajax decorator? Or override the js part >>> of the onchangeajaxbehaviour? >> >> Hmm.. sounds like a good starting point... thanks. >> >> BTW: I totally lost you on that lazy loading thing... the user would >> like the page to load in a snap and using it to be like a snap. How >> would your proposed lazy loading be implemented? >> >> ** >> Martin >>> >>> 2010/5/19 Jeremy Thomerson : Well, if the rendering of all that extra JS is what's causing the problem, I'd try to limit it to one rendering of the (slightly-modified) behavior. You can basically render something like this: function somethingInMyTableChanged(rowInd) { return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd); } Then, you add a simple behavior to your row items like: new SimpleAttributeModifier("onchange", true, new Model("return somethingInMyTableChanged(" + item.getRowIndex() + ");"); In your behavior, now you have to do a little extra work (don't use an onchangeajaxbehavior, just use a custom defaultajaxbehavior or something like that). You'll need to call RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex") and use that to see which row changed. Anyway, it should work, but it's a little less "clean" than you normally would do in Wicket. BUT - if you have proven that it's the rendering of all that extra AJAX string stuff that's slowing you down, then it's worth doing. -- Jeremy Thomerson http://www.wickettraining.com On Wed, May 19, 2010 at 11:09 AM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > Hi! > > Yes.. my question now is: how to easily extract the JS? It is from > onchangeajaxbehavior etc. > > I would like to continue using wicket standard onchangeajaxbehavior > but somehow override the way it injects the js into the component tag. > Suggestions to accomplish this? > > ** > Martin > > 2010/5/19 Jeremy Thomerson : > > If you've already proven that removing the AJAX removes the contention, > I'd > > go with Nino's "otherwise" route. That was my first guess. Depending > > on > > what you're doing with those AJAX calls, you could probably make it so > that > > you have one to three of them for the entire table, wrapped in a custom > > function. (You don't have to extract them to a separate JS). Then each > row > > would shorten it's JavaScript output to myCustomFunction(rowIndex). If > you > > need some help, let us know. I posted a message on this list a week or > so > > ago showing how to wrap existing AJAX in a custom function. That might > > help, too. > > > > -- > > Jeremy Thomerson > > http://www.wickettraining.com > > > > > > > > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael < > > nino.martinez.w...@gmail.com> wrote: > > > >> The easiest thing would probably to lazy load the rows somehow, how > >> are load time pr row?.. Otherwise you could extract the long inline > >> code into a seperate js and wrap them into induvidual methods, > >> although I do not know if it makes page load faster or there could be > >> other issues. > >> > >> 2010/5/19 Martin Makundi : > >> > Hi! > >> > > >> > HELP! > >> > > >> > I have a problem. I have a table with 20 columns and 30 rows > >> ("calendar"). > >> > > >> > The problem is that it renders very slowly in browsers. > >> > > >> > The reason is not directly network speed but it is the VERY heavy > >> > markup. Each table cell has 3 ajax components and the ajax call > >> > functions are loong. > >> > > >> > I have tested to strip away all ajax calls and it renders pretty OK. > >> > Now what I am thinking is that is there a way to shorten the wicket > >> > ajax call urls? > >> > > >> > Any practical suggestions? I tried also shortening the wicket-id > >> > names > >> > but there still remains quite some blob of excess markup that could > >> > brobably be in some reusable function?? > >> > > >> > Here is a sample markup of just one single cell and you can immagine > >> > how big of a blob it is when having 20x30 cells (copy-pasted from > >> > firebug): > >> > > >> > >> > name="p:f:ss:s:t:w:3:m:8:o" style="position: absolute; display: none; > >> > z-index: 2;" class="show-hide"> > >> > > >> > Option > >> > Another option >>>
Re: Help me speed up my Wicket
about the lazyloading, I was thinking to cascade load the rows after page render, it should perform better in theory:)... 2010/5/19 Martin Makundi : > Hi! > >> hmm could'nt just use a custom ajax decorator? Or override the js part >> of the onchangeajaxbehaviour? > > Hmm.. sounds like a good starting point... thanks. > > BTW: I totally lost you on that lazy loading thing... the user would > like the page to load in a snap and using it to be like a snap. How > would your proposed lazy loading be implemented? > > ** > Martin >> >> 2010/5/19 Jeremy Thomerson : >>> Well, if the rendering of all that extra JS is what's causing the problem, >>> I'd try to limit it to one rendering of the (slightly-modified) behavior. >>> >>> You can basically render something like this: >>> >>> function somethingInMyTableChanged(rowInd) { >>> return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd); >>> } >>> >>> Then, you add a simple behavior to your row items like: >>> >>> new SimpleAttributeModifier("onchange", true, new Model("return >>> somethingInMyTableChanged(" + item.getRowIndex() + ");"); >>> >>> In your behavior, now you have to do a little extra work (don't use an >>> onchangeajaxbehavior, just use a custom defaultajaxbehavior or something >>> like that). You'll need to call >>> RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex") >>> and use that to see which row changed. >>> >>> Anyway, it should work, but it's a little less "clean" than you normally >>> would do in Wicket. BUT - if you have proven that it's the rendering of all >>> that extra AJAX string stuff that's slowing you down, then it's worth doing. >>> >>> -- >>> Jeremy Thomerson >>> http://www.wickettraining.com >>> >>> >>> >>> On Wed, May 19, 2010 at 11:09 AM, Martin Makundi < >>> martin.maku...@koodaripalvelut.com> wrote: >>> Hi! Yes.. my question now is: how to easily extract the JS? It is from onchangeajaxbehavior etc. I would like to continue using wicket standard onchangeajaxbehavior but somehow override the way it injects the js into the component tag. Suggestions to accomplish this? ** Martin 2010/5/19 Jeremy Thomerson : > If you've already proven that removing the AJAX removes the contention, I'd > go with Nino's "otherwise" route. That was my first guess. Depending on > what you're doing with those AJAX calls, you could probably make it so that > you have one to three of them for the entire table, wrapped in a custom > function. (You don't have to extract them to a separate JS). Then each row > would shorten it's JavaScript output to myCustomFunction(rowIndex). If you > need some help, let us know. I posted a message on this list a week or so > ago showing how to wrap existing AJAX in a custom function. That might > help, too. > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael < > nino.martinez.w...@gmail.com> wrote: > >> The easiest thing would probably to lazy load the rows somehow, how >> are load time pr row?.. Otherwise you could extract the long inline >> code into a seperate js and wrap them into induvidual methods, >> although I do not know if it makes page load faster or there could be >> other issues. >> >> 2010/5/19 Martin Makundi : >> > Hi! >> > >> > HELP! >> > >> > I have a problem. I have a table with 20 columns and 30 rows >> ("calendar"). >> > >> > The problem is that it renders very slowly in browsers. >> > >> > The reason is not directly network speed but it is the VERY heavy >> > markup. Each table cell has 3 ajax components and the ajax call >> > functions are loong. >> > >> > I have tested to strip away all ajax calls and it renders pretty OK. >> > Now what I am thinking is that is there a way to shorten the wicket >> > ajax call urls? >> > >> > Any practical suggestions? I tried also shortening the wicket-id names >> > but there still remains quite some blob of excess markup that could >> > brobably be in some reusable function?? >> > >> > Here is a sample markup of just one single cell and you can immagine >> > how big of a blob it is when having 20x30 cells (copy-pasted from >> > firebug): >> > >> > >>> >> > name="p:f:ss:s:t:w:3:m:8:o" style="position: absolute; display: none; >> > z-index: 2;" class="show-hide"> >> > >> > Option >> > Another option >> > >> > >> > >>> >> > tabindex="008003" maxlength="1024" id="s4714" >> > name="p:f:ss:s:t:w:3:m:8:c:s" value="10-18" style="border: 1px solid >> > rgb(0, 255, 0);" >> > name="p:f:ss:s:t:w:3:m:8:c:r" style="position: absolute; displ
Re: Help me speed up my Wicket
Hi! > hmm could'nt just use a custom ajax decorator? Or override the js part > of the onchangeajaxbehaviour? Hmm.. sounds like a good starting point... thanks. BTW: I totally lost you on that lazy loading thing... the user would like the page to load in a snap and using it to be like a snap. How would your proposed lazy loading be implemented? ** Martin > > 2010/5/19 Jeremy Thomerson : >> Well, if the rendering of all that extra JS is what's causing the problem, >> I'd try to limit it to one rendering of the (slightly-modified) behavior. >> >> You can basically render something like this: >> >> function somethingInMyTableChanged(rowInd) { >> return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd); >> } >> >> Then, you add a simple behavior to your row items like: >> >> new SimpleAttributeModifier("onchange", true, new Model("return >> somethingInMyTableChanged(" + item.getRowIndex() + ");"); >> >> In your behavior, now you have to do a little extra work (don't use an >> onchangeajaxbehavior, just use a custom defaultajaxbehavior or something >> like that). You'll need to call >> RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex") >> and use that to see which row changed. >> >> Anyway, it should work, but it's a little less "clean" than you normally >> would do in Wicket. BUT - if you have proven that it's the rendering of all >> that extra AJAX string stuff that's slowing you down, then it's worth doing. >> >> -- >> Jeremy Thomerson >> http://www.wickettraining.com >> >> >> >> On Wed, May 19, 2010 at 11:09 AM, Martin Makundi < >> martin.maku...@koodaripalvelut.com> wrote: >> >>> Hi! >>> >>> Yes.. my question now is: how to easily extract the JS? It is from >>> onchangeajaxbehavior etc. >>> >>> I would like to continue using wicket standard onchangeajaxbehavior >>> but somehow override the way it injects the js into the component tag. >>> Suggestions to accomplish this? >>> >>> ** >>> Martin >>> >>> 2010/5/19 Jeremy Thomerson : >>> > If you've already proven that removing the AJAX removes the contention, >>> I'd >>> > go with Nino's "otherwise" route. That was my first guess. Depending on >>> > what you're doing with those AJAX calls, you could probably make it so >>> that >>> > you have one to three of them for the entire table, wrapped in a custom >>> > function. (You don't have to extract them to a separate JS). Then each >>> row >>> > would shorten it's JavaScript output to myCustomFunction(rowIndex). If >>> you >>> > need some help, let us know. I posted a message on this list a week or >>> so >>> > ago showing how to wrap existing AJAX in a custom function. That might >>> > help, too. >>> > >>> > -- >>> > Jeremy Thomerson >>> > http://www.wickettraining.com >>> > >>> > >>> > >>> > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael < >>> > nino.martinez.w...@gmail.com> wrote: >>> > >>> >> The easiest thing would probably to lazy load the rows somehow, how >>> >> are load time pr row?.. Otherwise you could extract the long inline >>> >> code into a seperate js and wrap them into induvidual methods, >>> >> although I do not know if it makes page load faster or there could be >>> >> other issues. >>> >> >>> >> 2010/5/19 Martin Makundi : >>> >> > Hi! >>> >> > >>> >> > HELP! >>> >> > >>> >> > I have a problem. I have a table with 20 columns and 30 rows >>> >> ("calendar"). >>> >> > >>> >> > The problem is that it renders very slowly in browsers. >>> >> > >>> >> > The reason is not directly network speed but it is the VERY heavy >>> >> > markup. Each table cell has 3 ajax components and the ajax call >>> >> > functions are loong. >>> >> > >>> >> > I have tested to strip away all ajax calls and it renders pretty OK. >>> >> > Now what I am thinking is that is there a way to shorten the wicket >>> >> > ajax call urls? >>> >> > >>> >> > Any practical suggestions? I tried also shortening the wicket-id names >>> >> > but there still remains quite some blob of excess markup that could >>> >> > brobably be in some reusable function?? >>> >> > >>> >> > Here is a sample markup of just one single cell and you can immagine >>> >> > how big of a blob it is when having 20x30 cells (copy-pasted from >>> >> > firebug): >>> >> > >>> >> > >> >> > name="p:f:ss:s:t:w:3:m:8:o" style="position: absolute; display: none; >>> >> > z-index: 2;" class="show-hide"> >>> >> > >>> >> > Option >>> >> > Another option >>> >> > >>> >> > >>> >> > >> >> > tabindex="008003" maxlength="1024" id="s4714" >>> >> > name="p:f:ss:s:t:w:3:m:8:c:s" value="10-18" style="border: 1px solid >>> >> > rgb(0, 255, 0);">>> >> > name="p:f:ss:s:t:w:3:m:8:c:r" style="position: absolute; display: >>> >> > none;" class="colors show-hide" size="1"> >>> >> > new stuff >>> >> > Option >>> >> > >> >> > type="text/javascript"><!--/*--><![CDATA[/*><!--*/ >>> >> > initializeShowHide('s4714','#r4715'); >>> >> > /*-->]]>*/ >>> >> > >>> >> > Info>> >> > type="text/
Re: Help me speed up my Wicket
hmm could'nt just use a custom ajax decorator? Or override the js part of the onchangeajaxbehaviour? 2010/5/19 Jeremy Thomerson : > Well, if the rendering of all that extra JS is what's causing the problem, > I'd try to limit it to one rendering of the (slightly-modified) behavior. > > You can basically render something like this: > > function somethingInMyTableChanged(rowInd) { > return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd); > } > > Then, you add a simple behavior to your row items like: > > new SimpleAttributeModifier("onchange", true, new Model("return > somethingInMyTableChanged(" + item.getRowIndex() + ");"); > > In your behavior, now you have to do a little extra work (don't use an > onchangeajaxbehavior, just use a custom defaultajaxbehavior or something > like that). You'll need to call > RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex") > and use that to see which row changed. > > Anyway, it should work, but it's a little less "clean" than you normally > would do in Wicket. BUT - if you have proven that it's the rendering of all > that extra AJAX string stuff that's slowing you down, then it's worth doing. > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > On Wed, May 19, 2010 at 11:09 AM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> Hi! >> >> Yes.. my question now is: how to easily extract the JS? It is from >> onchangeajaxbehavior etc. >> >> I would like to continue using wicket standard onchangeajaxbehavior >> but somehow override the way it injects the js into the component tag. >> Suggestions to accomplish this? >> >> ** >> Martin >> >> 2010/5/19 Jeremy Thomerson : >> > If you've already proven that removing the AJAX removes the contention, >> I'd >> > go with Nino's "otherwise" route. That was my first guess. Depending on >> > what you're doing with those AJAX calls, you could probably make it so >> that >> > you have one to three of them for the entire table, wrapped in a custom >> > function. (You don't have to extract them to a separate JS). Then each >> row >> > would shorten it's JavaScript output to myCustomFunction(rowIndex). If >> you >> > need some help, let us know. I posted a message on this list a week or >> so >> > ago showing how to wrap existing AJAX in a custom function. That might >> > help, too. >> > >> > -- >> > Jeremy Thomerson >> > http://www.wickettraining.com >> > >> > >> > >> > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael < >> > nino.martinez.w...@gmail.com> wrote: >> > >> >> The easiest thing would probably to lazy load the rows somehow, how >> >> are load time pr row?.. Otherwise you could extract the long inline >> >> code into a seperate js and wrap them into induvidual methods, >> >> although I do not know if it makes page load faster or there could be >> >> other issues. >> >> >> >> 2010/5/19 Martin Makundi : >> >> > Hi! >> >> > >> >> > HELP! >> >> > >> >> > I have a problem. I have a table with 20 columns and 30 rows >> >> ("calendar"). >> >> > >> >> > The problem is that it renders very slowly in browsers. >> >> > >> >> > The reason is not directly network speed but it is the VERY heavy >> >> > markup. Each table cell has 3 ajax components and the ajax call >> >> > functions are loong. >> >> > >> >> > I have tested to strip away all ajax calls and it renders pretty OK. >> >> > Now what I am thinking is that is there a way to shorten the wicket >> >> > ajax call urls? >> >> > >> >> > Any practical suggestions? I tried also shortening the wicket-id names >> >> > but there still remains quite some blob of excess markup that could >> >> > brobably be in some reusable function?? >> >> > >> >> > Here is a sample markup of just one single cell and you can immagine >> >> > how big of a blob it is when having 20x30 cells (copy-pasted from >> >> > firebug): >> >> > >> >> > > >> > name="p:f:ss:s:t:w:3:m:8:o" style="position: absolute; display: none; >> >> > z-index: 2;" class="show-hide"> >> >> > >> >> > Option >> >> > Another option >> >> > >> >> > >> >> > > >> > tabindex="008003" maxlength="1024" id="s4714" >> >> > name="p:f:ss:s:t:w:3:m:8:c:s" value="10-18" style="border: 1px solid >> >> > rgb(0, 255, 0);">> >> > name="p:f:ss:s:t:w:3:m:8:c:r" style="position: absolute; display: >> >> > none;" class="colors show-hide" size="1"> >> >> > new stuff >> >> > Option >> >> > > >> > type="text/javascript"><!--/*--><![CDATA[/*><!--*/ >> >> > initializeShowHide('s4714','#r4715'); >> >> > /*-->]]>*/ >> >> > >> >> > Info> >> > type="text/javascript"><!--/*--><![CDATA[/*><!--*/ >> >> > initializeShowHide('i4716','#memo-8-3', true); >> >> > /*-->]]>*/ >> >> > >> >> > > >> > src="/images/redcross.png"> >> >> > >> >> > >> >> > >> >> > ** >> >> > Martin >> >> > >> >> > - >> >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apach
Re: Help me speed up my Wicket
2010/5/19 Martin Makundi : > Hi! > >> Otherwise you could extract the long inline >> code into a seperate js and wrap them into induvidual methods, >> although I do not know if it makes page load faster or there could be >> other issues. > > I will try somehow the individual function approach. My point is, > however, that there is very little "unique" stuff in the functions. > They could probably be reduced into "ajaxCall(markup-id)" or > something. I am using built-in wicket ajaxbehaviors. Has someone done > this kind of squeezing before? > >> The easiest thing would probably to lazy load the rows somehow, how >> are load time pr row?.. > > Lazy load.. load time doesn't seem to be an issue. It is equally slow > to render even if rendered direclty from local hard drive as static > file. I know, thats why you only can compare with an page without rows, the lazyloading part should add rows induvidually (that should reduce the feeling of slow rendering), however it also depends on how ajaxy your page are to start with... > > ** > Martin > > >> >> 2010/5/19 Martin Makundi : >>> Hi! >>> >>> HELP! >>> >>> I have a problem. I have a table with 20 columns and 30 rows ("calendar"). >>> >>> The problem is that it renders very slowly in browsers. >>> >>> The reason is not directly network speed but it is the VERY heavy >>> markup. Each table cell has 3 ajax components and the ajax call >>> functions are loong. >>> >>> I have tested to strip away all ajax calls and it renders pretty OK. >>> Now what I am thinking is that is there a way to shorten the wicket >>> ajax call urls? >>> >>> Any practical suggestions? I tried also shortening the wicket-id names >>> but there still remains quite some blob of excess markup that could >>> brobably be in some reusable function?? >>> >>> Here is a sample markup of just one single cell and you can immagine >>> how big of a blob it is when having 20x30 cells (copy-pasted from >>> firebug): >>> >>> >> name="p:f:ss:s:t:w:3:m:8:o" style="position: absolute; display: none; >>> z-index: 2;" class="show-hide"> >>> >>> Option >>> Another option >>> >>> >>> >> tabindex="008003" maxlength="1024" id="s4714" >>> name="p:f:ss:s:t:w:3:m:8:c:s" value="10-18" style="border: 1px solid >>> rgb(0, 255, 0);">>> name="p:f:ss:s:t:w:3:m:8:c:r" style="position: absolute; display: >>> none;" class="colors show-hide" size="1"> >>> new stuff >>> Option >>> >> type="text/javascript"><!--/*--><![CDATA[/*><!--*/ >>> initializeShowHide('s4714','#r4715'); >>> /*-->]]>*/ >>> >>> Info>> type="text/javascript"><!--/*--><![CDATA[/*><!--*/ >>> initializeShowHide('i4716','#memo-8-3', true); >>> /*-->]]>*/ >>> >>> >> src="/images/redcross.png"> >>> >>> >>> >>> ** >>> Martin >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Help me speed up my Wicket
Hmm.. I am afraid of losing the component update processing in onchangeajaxbehavior and its superclasses. Actually the true solution is to leave out the selects completely ,] I wonder if I could render them somewhere else... like bottom of page and then just move them onto the table when displaying them. Hmm.. uh. ** Martin 2010/5/19 Jeremy Thomerson : > Well, if the rendering of all that extra JS is what's causing the problem, > I'd try to limit it to one rendering of the (slightly-modified) behavior. > > You can basically render something like this: > > function somethingInMyTableChanged(rowInd) { > return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd); > } > > Then, you add a simple behavior to your row items like: > > new SimpleAttributeModifier("onchange", true, new Model("return > somethingInMyTableChanged(" + item.getRowIndex() + ");"); > > In your behavior, now you have to do a little extra work (don't use an > onchangeajaxbehavior, just use a custom defaultajaxbehavior or something > like that). You'll need to call > RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex") > and use that to see which row changed. > > Anyway, it should work, but it's a little less "clean" than you normally > would do in Wicket. BUT - if you have proven that it's the rendering of all > that extra AJAX string stuff that's slowing you down, then it's worth doing. > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > On Wed, May 19, 2010 at 11:09 AM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> Hi! >> >> Yes.. my question now is: how to easily extract the JS? It is from >> onchangeajaxbehavior etc. >> >> I would like to continue using wicket standard onchangeajaxbehavior >> but somehow override the way it injects the js into the component tag. >> Suggestions to accomplish this? >> >> ** >> Martin >> >> 2010/5/19 Jeremy Thomerson : >> > If you've already proven that removing the AJAX removes the contention, >> I'd >> > go with Nino's "otherwise" route. That was my first guess. Depending on >> > what you're doing with those AJAX calls, you could probably make it so >> that >> > you have one to three of them for the entire table, wrapped in a custom >> > function. (You don't have to extract them to a separate JS). Then each >> row >> > would shorten it's JavaScript output to myCustomFunction(rowIndex). If >> you >> > need some help, let us know. I posted a message on this list a week or >> so >> > ago showing how to wrap existing AJAX in a custom function. That might >> > help, too. >> > >> > -- >> > Jeremy Thomerson >> > http://www.wickettraining.com >> > >> > >> > >> > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael < >> > nino.martinez.w...@gmail.com> wrote: >> > >> >> The easiest thing would probably to lazy load the rows somehow, how >> >> are load time pr row?.. Otherwise you could extract the long inline >> >> code into a seperate js and wrap them into induvidual methods, >> >> although I do not know if it makes page load faster or there could be >> >> other issues. >> >> >> >> 2010/5/19 Martin Makundi : >> >> > Hi! >> >> > >> >> > HELP! >> >> > >> >> > I have a problem. I have a table with 20 columns and 30 rows >> >> ("calendar"). >> >> > >> >> > The problem is that it renders very slowly in browsers. >> >> > >> >> > The reason is not directly network speed but it is the VERY heavy >> >> > markup. Each table cell has 3 ajax components and the ajax call >> >> > functions are loong. >> >> > >> >> > I have tested to strip away all ajax calls and it renders pretty OK. >> >> > Now what I am thinking is that is there a way to shorten the wicket >> >> > ajax call urls? >> >> > >> >> > Any practical suggestions? I tried also shortening the wicket-id names >> >> > but there still remains quite some blob of excess markup that could >> >> > brobably be in some reusable function?? >> >> > >> >> > Here is a sample markup of just one single cell and you can immagine >> >> > how big of a blob it is when having 20x30 cells (copy-pasted from >> >> > firebug): >> >> > >> >> > > >> > name="p:f:ss:s:t:w:3:m:8:o" style="position: absolute; display: none; >> >> > z-index: 2;" class="show-hide"> >> >> > >> >> > Option >> >> > Another option >> >> > >> >> > >> >> > > >> > tabindex="008003" maxlength="1024" id="s4714" >> >> > name="p:f:ss:s:t:w:3:m:8:c:s" value="10-18" style="border: 1px solid >> >> > rgb(0, 255, 0);">> >> > name="p:f:ss:s:t:w:3:m:8:c:r" style="position: absolute; display: >> >> > none;" class="colors show-hide" size="1"> >> >> > new stuff >> >> > Option >> >> > > >> > type="text/javascript"><!--/*--><![CDATA[/*><!--*/ >> >> > initializeShowHide('s4714','#r4715'); >> >> > /*-->]]>*/ >> >> > >> >> > Info> >> > type="text/javascript"><!--/*--><![CDATA[/*><!--*/ >> >> > initializeShowHide('i4716','#memo-8-3', true); >> >> > /*-->]]>*/ >> >> > >> >> > > >> > src
Re: Help me speed up my Wicket
Well, if the rendering of all that extra JS is what's causing the problem, I'd try to limit it to one rendering of the (slightly-modified) behavior. You can basically render something like this: function somethingInMyTableChanged(rowInd) { return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd); } Then, you add a simple behavior to your row items like: new SimpleAttributeModifier("onchange", true, new Model("return somethingInMyTableChanged(" + item.getRowIndex() + ");"); In your behavior, now you have to do a little extra work (don't use an onchangeajaxbehavior, just use a custom defaultajaxbehavior or something like that). You'll need to call RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex") and use that to see which row changed. Anyway, it should work, but it's a little less "clean" than you normally would do in Wicket. BUT - if you have proven that it's the rendering of all that extra AJAX string stuff that's slowing you down, then it's worth doing. -- Jeremy Thomerson http://www.wickettraining.com On Wed, May 19, 2010 at 11:09 AM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > Hi! > > Yes.. my question now is: how to easily extract the JS? It is from > onchangeajaxbehavior etc. > > I would like to continue using wicket standard onchangeajaxbehavior > but somehow override the way it injects the js into the component tag. > Suggestions to accomplish this? > > ** > Martin > > 2010/5/19 Jeremy Thomerson : > > If you've already proven that removing the AJAX removes the contention, > I'd > > go with Nino's "otherwise" route. That was my first guess. Depending on > > what you're doing with those AJAX calls, you could probably make it so > that > > you have one to three of them for the entire table, wrapped in a custom > > function. (You don't have to extract them to a separate JS). Then each > row > > would shorten it's JavaScript output to myCustomFunction(rowIndex). If > you > > need some help, let us know. I posted a message on this list a week or > so > > ago showing how to wrap existing AJAX in a custom function. That might > > help, too. > > > > -- > > Jeremy Thomerson > > http://www.wickettraining.com > > > > > > > > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael < > > nino.martinez.w...@gmail.com> wrote: > > > >> The easiest thing would probably to lazy load the rows somehow, how > >> are load time pr row?.. Otherwise you could extract the long inline > >> code into a seperate js and wrap them into induvidual methods, > >> although I do not know if it makes page load faster or there could be > >> other issues. > >> > >> 2010/5/19 Martin Makundi : > >> > Hi! > >> > > >> > HELP! > >> > > >> > I have a problem. I have a table with 20 columns and 30 rows > >> ("calendar"). > >> > > >> > The problem is that it renders very slowly in browsers. > >> > > >> > The reason is not directly network speed but it is the VERY heavy > >> > markup. Each table cell has 3 ajax components and the ajax call > >> > functions are loong. > >> > > >> > I have tested to strip away all ajax calls and it renders pretty OK. > >> > Now what I am thinking is that is there a way to shorten the wicket > >> > ajax call urls? > >> > > >> > Any practical suggestions? I tried also shortening the wicket-id names > >> > but there still remains quite some blob of excess markup that could > >> > brobably be in some reusable function?? > >> > > >> > Here is a sample markup of just one single cell and you can immagine > >> > how big of a blob it is when having 20x30 cells (copy-pasted from > >> > firebug): > >> > > >> > >> > name="p:f:ss:s:t:w:3:m:8:o" style="position: absolute; display: none; > >> > z-index: 2;" class="show-hide"> > >> > > >> > Option > >> > Another option > >> > > >> > > >> > >> > tabindex="008003" maxlength="1024" id="s4714" > >> > name="p:f:ss:s:t:w:3:m:8:c:s" value="10-18" style="border: 1px solid > >> > rgb(0, 255, 0);"> >> > name="p:f:ss:s:t:w:3:m:8:c:r" style="position: absolute; display: > >> > none;" class="colors show-hide" size="1"> > >> > new stuff > >> > Option > >> > >> > type="text/javascript"><!--/*--><![CDATA[/*><!--*/ > >> > initializeShowHide('s4714','#r4715'); > >> > /*-->]]>*/ > >> > > >> > Info >> > type="text/javascript"><!--/*--><![CDATA[/*><!--*/ > >> > initializeShowHide('i4716','#memo-8-3', true); > >> > /*-->]]>*/ > >> > > >> > >> > src="/images/redcross.png"> > >> > > >> > > >> > > >> > ** > >> > Martin > >> > > >> > - > >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> > For additional commands, e-mail: users-h...@wicket.apache.org > >> > > >> > > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> For additional commands, e-mail: users-h...@wicket.
Re: Help me speed up my Wicket
Hi! Yes.. my question now is: how to easily extract the JS? It is from onchangeajaxbehavior etc. I would like to continue using wicket standard onchangeajaxbehavior but somehow override the way it injects the js into the component tag. Suggestions to accomplish this? ** Martin 2010/5/19 Jeremy Thomerson : > If you've already proven that removing the AJAX removes the contention, I'd > go with Nino's "otherwise" route. That was my first guess. Depending on > what you're doing with those AJAX calls, you could probably make it so that > you have one to three of them for the entire table, wrapped in a custom > function. (You don't have to extract them to a separate JS). Then each row > would shorten it's JavaScript output to myCustomFunction(rowIndex). If you > need some help, let us know. I posted a message on this list a week or so > ago showing how to wrap existing AJAX in a custom function. That might > help, too. > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael < > nino.martinez.w...@gmail.com> wrote: > >> The easiest thing would probably to lazy load the rows somehow, how >> are load time pr row?.. Otherwise you could extract the long inline >> code into a seperate js and wrap them into induvidual methods, >> although I do not know if it makes page load faster or there could be >> other issues. >> >> 2010/5/19 Martin Makundi : >> > Hi! >> > >> > HELP! >> > >> > I have a problem. I have a table with 20 columns and 30 rows >> ("calendar"). >> > >> > The problem is that it renders very slowly in browsers. >> > >> > The reason is not directly network speed but it is the VERY heavy >> > markup. Each table cell has 3 ajax components and the ajax call >> > functions are loong. >> > >> > I have tested to strip away all ajax calls and it renders pretty OK. >> > Now what I am thinking is that is there a way to shorten the wicket >> > ajax call urls? >> > >> > Any practical suggestions? I tried also shortening the wicket-id names >> > but there still remains quite some blob of excess markup that could >> > brobably be in some reusable function?? >> > >> > Here is a sample markup of just one single cell and you can immagine >> > how big of a blob it is when having 20x30 cells (copy-pasted from >> > firebug): >> > >> > > > name="p:f:ss:s:t:w:3:m:8:o" style="position: absolute; display: none; >> > z-index: 2;" class="show-hide"> >> > >> > Option >> > Another option >> > >> > >> > > > tabindex="008003" maxlength="1024" id="s4714" >> > name="p:f:ss:s:t:w:3:m:8:c:s" value="10-18" style="border: 1px solid >> > rgb(0, 255, 0);">> > name="p:f:ss:s:t:w:3:m:8:c:r" style="position: absolute; display: >> > none;" class="colors show-hide" size="1"> >> > new stuff >> > Option >> > > > type="text/javascript"><!--/*--><![CDATA[/*><!--*/ >> > initializeShowHide('s4714','#r4715'); >> > /*-->]]>*/ >> > >> > Info> > type="text/javascript"><!--/*--><![CDATA[/*><!--*/ >> > initializeShowHide('i4716','#memo-8-3', true); >> > /*-->]]>*/ >> > >> > > > src="/images/redcross.png"> >> > >> > >> > >> > ** >> > Martin >> > >> > - >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> > For additional commands, e-mail: users-h...@wicket.apache.org >> > >> > >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Help me speed up my Wicket
If you've already proven that removing the AJAX removes the contention, I'd go with Nino's "otherwise" route. That was my first guess. Depending on what you're doing with those AJAX calls, you could probably make it so that you have one to three of them for the entire table, wrapped in a custom function. (You don't have to extract them to a separate JS). Then each row would shorten it's JavaScript output to myCustomFunction(rowIndex). If you need some help, let us know. I posted a message on this list a week or so ago showing how to wrap existing AJAX in a custom function. That might help, too. -- Jeremy Thomerson http://www.wickettraining.com On Wed, May 19, 2010 at 10:51 AM, nino martinez wael < nino.martinez.w...@gmail.com> wrote: > The easiest thing would probably to lazy load the rows somehow, how > are load time pr row?.. Otherwise you could extract the long inline > code into a seperate js and wrap them into induvidual methods, > although I do not know if it makes page load faster or there could be > other issues. > > 2010/5/19 Martin Makundi : > > Hi! > > > > HELP! > > > > I have a problem. I have a table with 20 columns and 30 rows > ("calendar"). > > > > The problem is that it renders very slowly in browsers. > > > > The reason is not directly network speed but it is the VERY heavy > > markup. Each table cell has 3 ajax components and the ajax call > > functions are loong. > > > > I have tested to strip away all ajax calls and it renders pretty OK. > > Now what I am thinking is that is there a way to shorten the wicket > > ajax call urls? > > > > Any practical suggestions? I tried also shortening the wicket-id names > > but there still remains quite some blob of excess markup that could > > brobably be in some reusable function?? > > > > Here is a sample markup of just one single cell and you can immagine > > how big of a blob it is when having 20x30 cells (copy-pasted from > > firebug): > > > > > name="p:f:ss:s:t:w:3:m:8:o" style="position: absolute; display: none; > > z-index: 2;" class="show-hide"> > > > > Option > > Another option > > > > > > > tabindex="008003" maxlength="1024" id="s4714" > > name="p:f:ss:s:t:w:3:m:8:c:s" value="10-18" style="border: 1px solid > > rgb(0, 255, 0);"> > name="p:f:ss:s:t:w:3:m:8:c:r" style="position: absolute; display: > > none;" class="colors show-hide" size="1"> > > new stuff > > Option > > > type="text/javascript"><!--/*--><![CDATA[/*><!--*/ > > initializeShowHide('s4714','#r4715'); > > /*-->]]>*/ > > > > Info > type="text/javascript"><!--/*--><![CDATA[/*><!--*/ > > initializeShowHide('i4716','#memo-8-3', true); > > /*-->]]>*/ > > > > > src="/images/redcross.png"> > > > > > > > > ** > > Martin > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Help me speed up my Wicket
Hi! > Otherwise you could extract the long inline > code into a seperate js and wrap them into induvidual methods, > although I do not know if it makes page load faster or there could be > other issues. I will try somehow the individual function approach. My point is, however, that there is very little "unique" stuff in the functions. They could probably be reduced into "ajaxCall(markup-id)" or something. I am using built-in wicket ajaxbehaviors. Has someone done this kind of squeezing before? > The easiest thing would probably to lazy load the rows somehow, how > are load time pr row?.. Lazy load.. load time doesn't seem to be an issue. It is equally slow to render even if rendered direclty from local hard drive as static file. ** Martin > > 2010/5/19 Martin Makundi : >> Hi! >> >> HELP! >> >> I have a problem. I have a table with 20 columns and 30 rows ("calendar"). >> >> The problem is that it renders very slowly in browsers. >> >> The reason is not directly network speed but it is the VERY heavy >> markup. Each table cell has 3 ajax components and the ajax call >> functions are loong. >> >> I have tested to strip away all ajax calls and it renders pretty OK. >> Now what I am thinking is that is there a way to shorten the wicket >> ajax call urls? >> >> Any practical suggestions? I tried also shortening the wicket-id names >> but there still remains quite some blob of excess markup that could >> brobably be in some reusable function?? >> >> Here is a sample markup of just one single cell and you can immagine >> how big of a blob it is when having 20x30 cells (copy-pasted from >> firebug): >> >> > name="p:f:ss:s:t:w:3:m:8:o" style="position: absolute; display: none; >> z-index: 2;" class="show-hide"> >> >> Option >> Another option >> >> >> > tabindex="008003" maxlength="1024" id="s4714" >> name="p:f:ss:s:t:w:3:m:8:c:s" value="10-18" style="border: 1px solid >> rgb(0, 255, 0);">> name="p:f:ss:s:t:w:3:m:8:c:r" style="position: absolute; display: >> none;" class="colors show-hide" size="1"> >> new stuff >> Option >> > type="text/javascript"><!--/*--><![CDATA[/*><!--*/ >> initializeShowHide('s4714','#r4715'); >> /*-->]]>*/ >> >> Info> type="text/javascript"><!--/*--><![CDATA[/*><!--*/ >> initializeShowHide('i4716','#memo-8-3', true); >> /*-->]]>*/ >> >> > src="/images/redcross.png"> >> >> >> >> ** >> Martin >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Help me speed up my Wicket
The easiest thing would probably to lazy load the rows somehow, how are load time pr row?.. Otherwise you could extract the long inline code into a seperate js and wrap them into induvidual methods, although I do not know if it makes page load faster or there could be other issues. 2010/5/19 Martin Makundi : > Hi! > > HELP! > > I have a problem. I have a table with 20 columns and 30 rows ("calendar"). > > The problem is that it renders very slowly in browsers. > > The reason is not directly network speed but it is the VERY heavy > markup. Each table cell has 3 ajax components and the ajax call > functions are loong. > > I have tested to strip away all ajax calls and it renders pretty OK. > Now what I am thinking is that is there a way to shorten the wicket > ajax call urls? > > Any practical suggestions? I tried also shortening the wicket-id names > but there still remains quite some blob of excess markup that could > brobably be in some reusable function?? > > Here is a sample markup of just one single cell and you can immagine > how big of a blob it is when having 20x30 cells (copy-pasted from > firebug): > > name="p:f:ss:s:t:w:3:m:8:o" style="position: absolute; display: none; > z-index: 2;" class="show-hide"> > > Option > Another option > > > tabindex="008003" maxlength="1024" id="s4714" > name="p:f:ss:s:t:w:3:m:8:c:s" value="10-18" style="border: 1px solid > rgb(0, 255, 0);"> name="p:f:ss:s:t:w:3:m:8:c:r" style="position: absolute; display: > none;" class="colors show-hide" size="1"> > new stuff > Option > type="text/javascript"><!--/*--><![CDATA[/*><!--*/ > initializeShowHide('s4714','#r4715'); > /*-->]]>*/ > > Info type="text/javascript"><!--/*--><![CDATA[/*><!--*/ > initializeShowHide('i4716','#memo-8-3', true); > /*-->]]>*/ > > src="/images/redcross.png"> > > > > ** > Martin > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Help me speed up my Wicket
Hi! HELP! I have a problem. I have a table with 20 columns and 30 rows ("calendar"). The problem is that it renders very slowly in browsers. The reason is not directly network speed but it is the VERY heavy markup. Each table cell has 3 ajax components and the ajax call functions are loong. I have tested to strip away all ajax calls and it renders pretty OK. Now what I am thinking is that is there a way to shorten the wicket ajax call urls? Any practical suggestions? I tried also shortening the wicket-id names but there still remains quite some blob of excess markup that could brobably be in some reusable function?? Here is a sample markup of just one single cell and you can immagine how big of a blob it is when having 20x30 cells (copy-pasted from firebug): Option Another option new stuff Option <!--/*--><![CDATA[/*><!--*/ initializeShowHide('s4714','#r4715'); /*-->]]>*/ Info<!--/*--><![CDATA[/*><!--*/ initializeShowHide('i4716','#memo-8-3', true); /*-->]]>*/ ** Martin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org