You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pablo Vázquez Blázquez <pv...@denodo.com> on 2008/11/17 17:08:31 UTC
Tabbed panel performance
Hi all,
I have a jspx with the following s:tabbedpanel:
<!-- TABS -->
<s:tabbedPanel id="jobTabs" doLayout="false" theme="simple">
<!-- EXTRACTION SECTION -->
<s:div id="extractionTab" cssClass="tab"
label="%{getText('EditJob.ExtractionSection')}" theme="ajax">
<jsp:directive.include file="ExtractionSectionARN.jspf"/>
</s:div>
<!-- FILTER EXPORTER SECTION -->
<s:div id="exporterTab" cssClass="tab"
label="%{getText('EditJob.FilterExporterSection')}" theme="ajax">
<jsp:directive.include file="FilterExporterSection.jspf"/>
</s:div>
<!-- HANDLERS SECTION -->
<s:div id="handlersTab" cssClass="tab"
label="%{getText('EditJob.HandlersSection')}" theme="ajax">
<jsp:directive.include file="HandlerSection.jspf"/>
</s:div>
<!-- TRIGGERS SECTION -->
<s:div id="triggersTab" cssClass="tab"
label="%{getText('EditJob.TriggersSection')}" theme="ajax">
<jsp:directive.include file="TriggerSection.jspf"/>
</s:div>
</s:tabbedPanel>
The more I access to this page, the more it takes to be loaded.... Some
times, it appears a firefox alert, asking me if continue executing an
script that takes so much time or cancel it. I have profiled it using
firebug and here are some results:
nameAnonFunc() 207 63.85% 4147.991ms 4246.583ms 20.515ms
16.399ms 76.873ms dojo.js (línea 1505)
createNodesFromText() 102 6.42% 417.12ms 479.95ms 4.705ms
3.096ms 51.62ms dojo.js (línea 3909)
parseElement() 1234 4.43% 287.682ms 521.91ms 0.423ms 0ms
244.949ms dojo.js (línea 7080)
(?)() 1 2.88% 186.815ms 3423.747ms 3423.747ms 3423.747ms
3423.747ms dojo.js (línea 12167)
replaceNode() 104 2.43% 158.156ms 158.156ms 1.521ms 0.151ms
30.545ms dojo.js (línea 2201)
createWidget() 102 1.92% 124.997ms 1017.089ms 9.971ms 2.181ms
80.041ms dojo.js (línea 10415)
Is there any tip to improve the performance of the tabbedpanel?
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tabbed panel performance
Posted by Pablo Vázquez Blázquez <pv...@denodo.com>.
Hi Andras, thank you for your response.
I am using struts 2.0.9 with a dojo-0.4.3 build, so if I have a s:div
with a href attribute for each tab, I would be invoking the action each
time I go to the tab, isn't it? If so, it doesn't work for me, as my
tabbed panel represents an only form, but divided into 4 sections.
Thank you.
Andras Balogh escribió:
> Hi,
>
> As I see you include different jspf in each tab, can you try to use
> the "href" attribute to load the content of each
> tab and see if there is a difference in the performance?
> See here about the "href" attribute:
> http://struts.apache.org/2.0.11.2/docs/tabbedpanel.html
>
> Best regards,
> Andras.
>
> Pablo Vázquez Blázquez wrote:
>> Any idea about why am I getting increasing response times each time I
>> access to the page?
>>
>> I have already a great response time the first time I access to the
>> page (which is also a problem), but my main problem is that after 6
>> or 7 accesses it in unmanageable...
>>
>> Thanks!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tabbed panel performance
Posted by Andras Balogh <an...@reea.net>.
Hi,
As I see you include different jspf in each tab, can you try to use the
"href" attribute to load the content of each
tab and see if there is a difference in the performance?
See here about the "href" attribute:
http://struts.apache.org/2.0.11.2/docs/tabbedpanel.html
Best regards,
Andras.
Pablo Vázquez Blázquez wrote:
> Any idea about why am I getting increasing response times each time I
> access to the page?
>
> I have already a great response time the first time I access to the
> page (which is also a problem), but my main problem is that after 6 or
> 7 accesses it in unmanageable...
>
> Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Tabbed panel performance
Posted by Mileidys Gonzalez Prieto <mi...@i-frontier.net>.
I'm using tab panels with the ajaxtags library, and for me is very good.
Mileidys González Prieto
Consultant
i-Frontier
Henck Arronstraat 16 | P.O.Box 12858 | Paramaribo, Suriname (SA)
Office: (597)-424073 | Mobile: (597)-8810219
www.i-frontier.net
-----Original Message-----
From: Jeromy Evans [mailto:jeromy.evans@blueskyminds.com.au]
Sent: Tuesday, November 18, 2008 8:00 PM
To: Struts Users Mailing List
Subject: Re: Tabbed panel performance
Hi Pablo,
Consider creating a custom profile for dojo. This makes a significant
improvement to the page load time as it reduces the number of http
requests (read on first though)
http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-20x
.html
The reload problem you're encountering is that you're either
accumulating too many objects in memory or too many nodes in the DOM.
Use Firebug to make sure the previous versions of the tabs are not still
in the DOM somewhere. Next, you'll have to ensure the widgets objects
Dojo created are released from memory before creating them again after
the reload (I've never done this...not sure how to ask dojo to dispose
of them), and finally you'll have to ensure any listeners attached to
DOM nodes inside your tabs are released (this causes major memory leaks
in IE if they're not). All of this has to be controlled using the Dojo
API, not the struts 2 tags.
The dojo struts2 tags in 2.1 include an attribute to control whether
dojo should parse the content for widgets. This makes a significant
performance improvement rendering tabs that contain a lot of markup.
This feature is available in Struts 2.0 version of dojo, but not as an
attribute of the Struts2 tag. Again, you'll have to dig into the
Dojo/widget API to enable the feature.
When I reached that point of complexity (and slowness) I stopped using
Dojo and switched to another library. When you're using the Dojo API
the benefit of the struts2 tags is completely lost. Most people love
JQuery. I use YUI. Dojo1.x looks good too, but I was too burnt to try
it. Migrating from the struts2 tags may be a significant effort if you
have a lot of notifiers in there, but JQuery and YUI are such a pleasure
to use compared to the Struts2 tags so I think you'll find conversion a
positive experience without regret.
Good luck!
regards,
Jeromy Evans
Pablo Vázquez Blázquez wrote:
> Just a bit more information. I have profiled (using firebug) the
> action (always the same action with the same content) with and without
> the <s:tabbedpanel> tag and here are the results:
>
> Without:
> ---
> 1727.355ms
> 1424.947ms
> 1748.429ms
> 1523.518ms
> 1539.649ms
> 1606.369ms
> 1657.058ms
> 1599.767ms
> 1632.157ms
> 1564.907ms
>
> With:
> ----
> 2294.719ms
> 2513.386ms
> 3398.823ms
> 4414.39ms
> 5716.896ms
> 7383.391ms
> 10188.268ms
> 12604.345ms
> 15876.5ms
> 20576.395ms
>
> As you can see, executing the action with the tag multiplies by 10 the
> response time!, while when not using the tag, response times are more
> or less equilibrated.
>
>
> Jeromy Evans escribió:
>> Pablo Vázquez Blázquez wrote:
>>> Any idea about why am I getting increasing response times each time
>>> I access to the page?
>>>
>>> I have already a great response time the first time I access to the
>>> page (which is also a problem), but my main problem is that after 6
>>> or 7 accesses it in unmanageable...
>>>
>>> Thanks!
>>
>> I don't recall the 0.4 dojo tabbed panel being particularly slow to
>> render, other than the extreme initial page load while Dojo makes too
>> many http requests.
>>
>> I can't think of any reason why it would get slower after a genuine
>> page reload with the same content (if it's reloading via ajax
>> though, then there's a good reason). The reload problem is not
>> evident in the showcase: it's consistently unbearably slow for each
>> reload at planetstruts.
>> Dojo parses your html for widget markup, so it there's a lot of
>> mark-up inside the tabs it's going to be slooowww (such as tables).
>>
>> Whenever I had a dojo problem I created a simplified page of html
>> with just the one widget on it to isolate the cause. You're putting
>> yourself through unnecessary torture by not using a newer client-side
>> library though.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tabbed panel performance
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Hi Pablo,
Consider creating a custom profile for dojo. This makes a significant
improvement to the page load time as it reduces the number of http
requests (read on first though)
http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-20x.html
The reload problem you're encountering is that you're either
accumulating too many objects in memory or too many nodes in the DOM.
Use Firebug to make sure the previous versions of the tabs are not still
in the DOM somewhere. Next, you'll have to ensure the widgets objects
Dojo created are released from memory before creating them again after
the reload (I've never done this...not sure how to ask dojo to dispose
of them), and finally you'll have to ensure any listeners attached to
DOM nodes inside your tabs are released (this causes major memory leaks
in IE if they're not). All of this has to be controlled using the Dojo
API, not the struts 2 tags.
The dojo struts2 tags in 2.1 include an attribute to control whether
dojo should parse the content for widgets. This makes a significant
performance improvement rendering tabs that contain a lot of markup.
This feature is available in Struts 2.0 version of dojo, but not as an
attribute of the Struts2 tag. Again, you'll have to dig into the
Dojo/widget API to enable the feature.
When I reached that point of complexity (and slowness) I stopped using
Dojo and switched to another library. When you're using the Dojo API
the benefit of the struts2 tags is completely lost. Most people love
JQuery. I use YUI. Dojo1.x looks good too, but I was too burnt to try
it. Migrating from the struts2 tags may be a significant effort if you
have a lot of notifiers in there, but JQuery and YUI are such a pleasure
to use compared to the Struts2 tags so I think you'll find conversion a
positive experience without regret.
Good luck!
regards,
Jeromy Evans
Pablo Vázquez Blázquez wrote:
> Just a bit more information. I have profiled (using firebug) the
> action (always the same action with the same content) with and without
> the <s:tabbedpanel> tag and here are the results:
>
> Without:
> ---
> 1727.355ms
> 1424.947ms
> 1748.429ms
> 1523.518ms
> 1539.649ms
> 1606.369ms
> 1657.058ms
> 1599.767ms
> 1632.157ms
> 1564.907ms
>
> With:
> ----
> 2294.719ms
> 2513.386ms
> 3398.823ms
> 4414.39ms
> 5716.896ms
> 7383.391ms
> 10188.268ms
> 12604.345ms
> 15876.5ms
> 20576.395ms
>
> As you can see, executing the action with the tag multiplies by 10 the
> response time!, while when not using the tag, response times are more
> or less equilibrated.
>
>
> Jeromy Evans escribió:
>> Pablo Vázquez Blázquez wrote:
>>> Any idea about why am I getting increasing response times each time
>>> I access to the page?
>>>
>>> I have already a great response time the first time I access to the
>>> page (which is also a problem), but my main problem is that after 6
>>> or 7 accesses it in unmanageable...
>>>
>>> Thanks!
>>
>> I don't recall the 0.4 dojo tabbed panel being particularly slow to
>> render, other than the extreme initial page load while Dojo makes too
>> many http requests.
>>
>> I can't think of any reason why it would get slower after a genuine
>> page reload with the same content (if it's reloading via ajax
>> though, then there's a good reason). The reload problem is not
>> evident in the showcase: it's consistently unbearably slow for each
>> reload at planetstruts.
>> Dojo parses your html for widget markup, so it there's a lot of
>> mark-up inside the tabs it's going to be slooowww (such as tables).
>>
>> Whenever I had a dojo problem I created a simplified page of html
>> with just the one widget on it to isolate the cause. You're putting
>> yourself through unnecessary torture by not using a newer client-side
>> library though.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tabbed panel performance
Posted by Pablo Vázquez Blázquez <pv...@denodo.com>.
Just a bit more information. I have profiled (using firebug) the action
(always the same action with the same content) with and without the
<s:tabbedpanel> tag and here are the results:
Without:
---
1727.355ms
1424.947ms
1748.429ms
1523.518ms
1539.649ms
1606.369ms
1657.058ms
1599.767ms
1632.157ms
1564.907ms
With:
----
2294.719ms
2513.386ms
3398.823ms
4414.39ms
5716.896ms
7383.391ms
10188.268ms
12604.345ms
15876.5ms
20576.395ms
As you can see, executing the action with the tag multiplies by 10 the
response time!, while when not using the tag, response times are more or
less equilibrated.
Jeromy Evans escribió:
> Pablo Vázquez Blázquez wrote:
>> Any idea about why am I getting increasing response times each time I
>> access to the page?
>>
>> I have already a great response time the first time I access to the
>> page (which is also a problem), but my main problem is that after 6
>> or 7 accesses it in unmanageable...
>>
>> Thanks!
>
> I don't recall the 0.4 dojo tabbed panel being particularly slow to
> render, other than the extreme initial page load while Dojo makes too
> many http requests.
>
> I can't think of any reason why it would get slower after a genuine
> page reload with the same content (if it's reloading via ajax though,
> then there's a good reason). The reload problem is not evident in the
> showcase: it's consistently unbearably slow for each reload at
> planetstruts.
> Dojo parses your html for widget markup, so it there's a lot of
> mark-up inside the tabs it's going to be slooowww (such as tables).
>
> Whenever I had a dojo problem I created a simplified page of html with
> just the one widget on it to isolate the cause. You're putting
> yourself through unnecessary torture by not using a newer client-side
> library though.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tabbed panel performance
Posted by Pablo Vázquez Blázquez <pv...@denodo.com>.
If in my code I comment the tabbedpanel tag, it works fine...
<!-- TABS -->
<!-- <s:tabbedPanel id="jobTabs" doLayout="false" theme="simple"> -->
<!-- EXTRACTION SECTION -->
<s:div id="extractionTab" cssClass="tab"
label="%{getText('EditJob.ExtractionSection')}" theme="ajax">
<jsp:directive.include file="ExtractionSectionARN.jspf"/>
</s:div>
<!-- FILTER EXPORTER SECTION -->
<s:div id="exporterTab" cssClass="tab"
label="%{getText('EditJob.FilterExporterSection')}" theme="ajax">
<jsp:directive.include file="FilterExporterSection.jspf"/>
</s:div>
<!-- HANDLERS SECTION -->
<s:div id="handlersTab" cssClass="tab"
label="%{getText('EditJob.HandlersSection')}" theme="ajax">
<jsp:directive.include file="HandlerSection.jspf"/>
</s:div>
<!-- TRIGGERS SECTION -->
<s:div id="triggersTab" cssClass="tab"
label="%{getText('EditJob.TriggersSection')}" theme="ajax">
<jsp:directive.include file="TriggerSection.jspf"/>
</s:div>
<!-- </s:tabbedPanel> -->
Jeromy Evans escribió:
> Pablo Vázquez Blázquez wrote:
>> Any idea about why am I getting increasing response times each time I
>> access to the page?
>>
>> I have already a great response time the first time I access to the
>> page (which is also a problem), but my main problem is that after 6
>> or 7 accesses it in unmanageable...
>>
>> Thanks!
>
> I don't recall the 0.4 dojo tabbed panel being particularly slow to
> render, other than the extreme initial page load while Dojo makes too
> many http requests.
>
> I can't think of any reason why it would get slower after a genuine
> page reload with the same content (if it's reloading via ajax though,
> then there's a good reason). The reload problem is not evident in the
> showcase: it's consistently unbearably slow for each reload at
> planetstruts.
> Dojo parses your html for widget markup, so it there's a lot of
> mark-up inside the tabs it's going to be slooowww (such as tables).
>
> Whenever I had a dojo problem I created a simplified page of html with
> just the one widget on it to isolate the cause. You're putting
> yourself through unnecessary torture by not using a newer client-side
> library though.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tabbed panel performance
Posted by Pablo Vázquez Blázquez <pv...@denodo.com>.
> I don't recall the 0.4 dojo tabbed panel being particularly slow to
> render, other than the extreme initial page load while Dojo makes too
> many http requests.
>
> I can't think of any reason why it would get slower after a genuine
> page reload with the same content (if it's reloading via ajax though,
> then there's a good reason). The reload problem is not evident in the
> showcase: it's consistently unbearably slow for each reload at
> planetstruts.
It's loaded and reloaded via ajax...
> Dojo parses your html for widget markup, so it there's a lot of
> mark-up inside the tabs it's going to be slooowww (such as tables).
Yes, there is a lot of mark-up inside the tabs. I can accept the
slowness, but not the increasing each time I reload it (via ajax).
>
> Whenever I had a dojo problem I created a simplified page of html with
> just the one widget on it to isolate the cause. You're putting
> yourself through unnecessary torture by not using a newer client-side
> library though.
Which client-side library do you recommend me? I have built a project
based on struts2 and dojo 0.4.x, so... changing this library would imply
a lot of re-factoring work, wouldn´t it?
Thank you for your response.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tabbed panel performance
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Pablo Vázquez Blázquez wrote:
> Any idea about why am I getting increasing response times each time I
> access to the page?
>
> I have already a great response time the first time I access to the
> page (which is also a problem), but my main problem is that after 6 or
> 7 accesses it in unmanageable...
>
> Thanks!
I don't recall the 0.4 dojo tabbed panel being particularly slow to
render, other than the extreme initial page load while Dojo makes too
many http requests.
I can't think of any reason why it would get slower after a genuine page
reload with the same content (if it's reloading via ajax though, then
there's a good reason). The reload problem is not evident in the
showcase: it's consistently unbearably slow for each reload at
planetstruts.
Dojo parses your html for widget markup, so it there's a lot of mark-up
inside the tabs it's going to be slooowww (such as tables).
Whenever I had a dojo problem I created a simplified page of html with
just the one widget on it to isolate the cause. You're putting yourself
through unnecessary torture by not using a newer client-side library though.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tabbed panel performance
Posted by Pablo Vázquez Blázquez <pv...@denodo.com>.
Any idea about why am I getting increasing response times each time I
access to the page?
I have already a great response time the first time I access to the page
(which is also a problem), but my main problem is that after 6 or 7
accesses it in unmanageable...
Thanks!
Pablo Vázquez Blázquez escribió:
> Hi all,
>
> I have a jspx with the following s:tabbedpanel:
>
> <!-- TABS -->
> <s:tabbedPanel id="jobTabs" doLayout="false" theme="simple">
>
> <!-- EXTRACTION SECTION -->
> <s:div id="extractionTab" cssClass="tab"
> label="%{getText('EditJob.ExtractionSection')}" theme="ajax">
> <jsp:directive.include file="ExtractionSectionARN.jspf"/>
> </s:div>
> <!-- FILTER EXPORTER SECTION -->
> <s:div id="exporterTab" cssClass="tab"
> label="%{getText('EditJob.FilterExporterSection')}" theme="ajax">
> <jsp:directive.include file="FilterExporterSection.jspf"/>
> </s:div>
>
> <!-- HANDLERS SECTION -->
> <s:div id="handlersTab" cssClass="tab"
> label="%{getText('EditJob.HandlersSection')}" theme="ajax">
> <jsp:directive.include file="HandlerSection.jspf"/>
> </s:div>
>
> <!-- TRIGGERS SECTION -->
> <s:div id="triggersTab" cssClass="tab"
> label="%{getText('EditJob.TriggersSection')}" theme="ajax">
> <jsp:directive.include file="TriggerSection.jspf"/>
> </s:div>
>
> </s:tabbedPanel>
>
> The more I access to this page, the more it takes to be loaded....
> Some times, it appears a firefox alert, asking me if continue
> executing an script that takes so much time or cancel it. I have
> profiled it using firebug and here are some results:
>
> nameAnonFunc() 207 63.85% 4147.991ms 4246.583ms
> 20.515ms 16.399ms 76.873ms dojo.js (línea 1505)
> createNodesFromText() 102 6.42% 417.12ms 479.95ms
> 4.705ms 3.096ms 51.62ms dojo.js (línea 3909)
> parseElement() 1234 4.43% 287.682ms 521.91ms
> 0.423ms 0ms 244.949ms dojo.js (línea 7080)
> (?)() 1 2.88% 186.815ms 3423.747ms 3423.747ms
> 3423.747ms 3423.747ms dojo.js (línea 12167)
> replaceNode() 104 2.43% 158.156ms 158.156ms
> 1.521ms 0.151ms 30.545ms dojo.js (línea 2201)
> createWidget() 102 1.92% 124.997ms 1017.089ms
> 9.971ms 2.181ms 80.041ms dojo.js (línea 10415)
>
>
> Is there any tip to improve the performance of the tabbedpanel?
>
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org