Re: Performance issue with nested iterator

2012-07-05 Thread Miguel Almeida
Sure, Lukas:

https://github.com/mmalmeida/struts-performance



On Thu, 2012-07-05 at 06:48 +0200, Lukasz Lenart wrote:

 Could you post somewhere (GitHub) the whole code base ?
 
 
 Regards




Re: Performance issue with nested iterator

2012-07-05 Thread Miguel Almeida
Sorry, I sent the email before explaining.

The repo has a maven project that I stripped down to the most basic to
show the issue. Notice the iterator in index.jsp.

I tried to remove every unused configuration, file and dependency to
make the project as simple as possible.

The original project is using tiles, so I kept it there. However, I
don't think it's being used in the web workflow I created (which just
goes to index.jsp).

Is there anything there that might explain this slowness?

Cheers,

Miguel Almeida

On Thu, 2012-07-05 at 13:05 +0100, Miguel Almeida wrote:

 Sure, Lukas:
 
 https://github.com/mmalmeida/struts-performance
 
 
 
 On Thu, 2012-07-05 at 06:48 +0200, Lukasz Lenart wrote:
 
  Could you post somewhere (GitHub) the whole code base ?
  
  
  Regards
 
 




Re: Performance issue with nested iterator

2012-07-05 Thread Miguel Almeida
I believe I've found the culprit.
While the problem is present in commit
https://github.com/mmalmeida/struts-performance/commit/aba93098174c8c8c1684ffdd9bf332b212a893a
 , it's not present in the latest commit if you turn devMode to false. 

The issue was the freemarker version 2.3.9 in that commit. Updating to
2.3.19 makes performance normal again (the complete project needed
freemarker, hence the direct dependency reference in the pom).

While I don't know what changed between these freemarker versions,
apparently the problem was there.

Miguel Almeida

On Thu, 2012-07-05 at 13:16 +0100, Miguel Almeida wrote:

 Sorry, I sent the email before explaining.
 
 The repo has a maven project that I stripped down to the most basic to
 show the issue. Notice the iterator in index.jsp.
 
 I tried to remove every unused configuration, file and dependency to
 make the project as simple as possible.
 
 The original project is using tiles, so I kept it there. However, I
 don't think it's being used in the web workflow I created (which just
 goes to index.jsp).
 
 Is there anything there that might explain this slowness?
 
 Cheers,
 
 Miguel Almeida
 
 On Thu, 2012-07-05 at 13:05 +0100, Miguel Almeida wrote:
 
  Sure, Lukas:
  
  https://github.com/mmalmeida/struts-performance
  
  
  
  On Thu, 2012-07-05 at 06:48 +0200, Lukasz Lenart wrote:
  
   Could you post somewhere (GitHub) the whole code base ?
   
   
   Regards
  
  
 
 




Re: Performance issue with nested iterator

2012-07-05 Thread Łukasz Lenart
Thanks! The latest version of S2 is already using 2.3.19


Kind regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/


2012/7/5 Miguel Almeida mig...@almeida.at:
 I believe I've found the culprit.
 While the problem is present in commit
 https://github.com/mmalmeida/struts-performance/commit/aba93098174c8c8c1684ffdd9bf332b212a893a
  , it's not present in the latest commit if you turn devMode to false.

 The issue was the freemarker version 2.3.9 in that commit. Updating to
 2.3.19 makes performance normal again (the complete project needed
 freemarker, hence the direct dependency reference in the pom).

 While I don't know what changed between these freemarker versions,
 apparently the problem was there.

 Miguel Almeida

 On Thu, 2012-07-05 at 13:16 +0100, Miguel Almeida wrote:

 Sorry, I sent the email before explaining.

 The repo has a maven project that I stripped down to the most basic to
 show the issue. Notice the iterator in index.jsp.

 I tried to remove every unused configuration, file and dependency to
 make the project as simple as possible.

 The original project is using tiles, so I kept it there. However, I
 don't think it's being used in the web workflow I created (which just
 goes to index.jsp).

 Is there anything there that might explain this slowness?

 Cheers,

 Miguel Almeida

 On Thu, 2012-07-05 at 13:05 +0100, Miguel Almeida wrote:

  Sure, Lukas:
 
  https://github.com/mmalmeida/struts-performance
 
 
 
  On Thu, 2012-07-05 at 06:48 +0200, Lukasz Lenart wrote:
 
   Could you post somewhere (GitHub) the whole code base ?
  
  
   Regards
 
 





-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Performance issue with nested iterator

2012-07-04 Thread Miguel Almeida
Dear all,

I have got a performance issue on a nested iterator, running Struts
2.3.1.1.

Consider the code below, (the example is a Book with chapters and
subchapters and we're displaying the book index -  bookIndex is a
MapChapter,ListSubchapter.

This takes several seconds to load (map has size 10, each list is no
more than 15 items). I tried a lot of different approaches (mainly
regarding the database). However, what really surprised me was the
contents of the innermost td (6th row from the end): if I replace the
s:a with anything else (a xx, or just an axx/a) the page will load
much faster (ie, page load drops from 8 to 2 seconds).

Looking at http://struts.apache.org/2.x/docs/performance-tuning.html, I
double checked the OGNL version loaded in maven and indeed I have 3.0.3.

Is there any obvious reason why I'm getting such a slow performance?

Thanks for the input!

Miguel Almeida


Example code:

s:iterator value=%{#bookIndex} status=row var=chapterIndex
s:set var=chapter value=%{#bookIndex.key}/
s:set var=subchapters value=%{#chapterIndex.value}/
br
s:url id=url action=chapterloadPage
s:param name=page${chapter.firstPage}/s:param
/s:url
s:a href=%{url}${chapter.name}/s:a
table
s:iterator value=%{#subchapters} status=ind 
var=subchapter  
s:url id=url 
action=chapterloadPage
s:param name=pages:property
value=%{#subchapter.page}//s:param
/s:url
tr
td 
s:a 
href=%{url}s:property
value=%{#subchapter.title}//s:a
/td
/tr
/s:iterator
/table
/s:iterator


Re: Performance issue with nested iterator

2012-07-04 Thread Lukasz Lenart
Could you post somewhere (GitHub) the whole code base ?


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org