Re : Re : Re : Performance issue in simpleTags and tagfiles

2011-09-08 Thread Adrian Gonzalez
Just downloaded JProfiler eval.

Compared tagfile performance between 7.0.21 and 7.0.trunk (this one this time 
: http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/)

With your optimization, we achieve a 24% performance gain - nice ;) 

Test         7.0.21    7.0.trunk
tagfile       267ms      206ms

You can see JConsole output
 * 7.0.21 : http://imageshack.us/photo/my-images/233/tagperftagfile7021.jpg/
 * 7.0.trunk 
: http://imageshack.us/photo/my-images/52/tagperftagfile70trunk.jpg/

Tests were made 
with http://localhost:8080/tagfilesperf/generated/edit-tagfile.jsp


One more question though : 
Do you think we can cache ValueExpression instances ?
Caching those instance, we could gain 14% more performance on this use case.
If we can cache them, what would be a good cache key ? 
(expressionAsStringjspPageName ?)

Also, need to update classictag performance suite, there's a problem in it.
I'l then do one more comparison test between classictag and tagfile.

Note : this is once more my home computer, but using JProfiler is a bit more 
accurate I think.

-- Details --
7.0.21 - tagfile 
Total time : [267 ms] in edit-tagfile.jsp 
Note : if not specified, units in microseconds
[860] 1 iteration 
- [565]doTag (cf input_tagx.java code)
- [450] PageContextImpl.proprietaryEvaluate
- [249] ValueExpressionImpl.getValue
- [122] ElExpressionFactoryImpl.createValueExpression [note 1]
- [236]DefaultInstanceManager.newInstance
- [203] DefaultInstanceManager.processAnnotations [note 2]

note 1 : 14% gain
Perhaps we can optimize here caching ValueExpressions instance (caching where 
since tagfiles are not pooled ?).
What would be the key of such a cache ? expression+jsp.class ?
note 2 : 23.6% gain : Mark optimization.
Cache annotation processing.

7.0.trunk - tagfile
Total time : [206 ms] edit-tagfile.jsp 
[687] 1 iteration 
- [586]doTag (cf input_tagx.java code)
- [470] PageContextImpl.proprietaryEvaluate
- [269] ValueExpressionImpl.getValue
- [127] ElExpressionFactoryImpl.createValueExpression [note 1]
- [44] DefaultInstanceManager.newInstance
- [10] DefaultInstanceManager.processAnnotations [note 2]


Thanks !!!

- Mail original -
De : Mark Thomas ma...@apache.org
À : Tomcat Users List users@tomcat.apache.org
Cc : 
Envoyé le : Mercredi 7 Septembre 2011 22h20
Objet : Re: Re : Re : Performance issue in simpleTags and tagfiles

On 07/09/2011 20:36, Adrian Gonzalez wrote:
 Sorry, no real difference.
 
 Even worse, I'm on my home computer and here I don't see anymore the *5 
 difference between simple tags and classic tags.

The figures I saw were:
Test    OP      Me      Cached
tagfile 500     328     203
classic 100     141     156
simple  500     250     156
none    94      140     156

A slight increase in the case where the cache isn't used and a
reasonable improvement in the other cases.

Performance tuning is always going to be system dependent. In this case
I think there us enough evidence to justify putting in the cache - even
if this is effectively a micro benchmark.

 I'll continue these tests tomorrow at work (perhaps there's some file 
 scanning / reading in action - and since I'm with AV software...).

I'd be very interested to see those results.

  - Tests results - 
 
 Downloaded tomcat trunk sources from 
 http://svn.apache.org/repos/asf/tomcat/trunk/

That is actually 8.0.x but there is currently very little difference
between that an 7.0.x with is at:
http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/

Cheers,

Mark

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

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



Re: Re : Re : Re : Performance issue in simpleTags and tagfiles

2011-09-08 Thread Mark Thomas
On 08/09/2011 09:59, Adrian Gonzalez wrote:
 Just downloaded JProfiler eval.
 
 Compared tagfile performance between 7.0.21 and 7.0.trunk (this one this time 
 : http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/)
 
 With your optimization, we achieve a 24% performance gain - nice ;) 
 
 Test 7.0.217.0.trunk
 tagfile   267ms  206ms
 
 You can see JConsole output
  * 7.0.21 : http://imageshack.us/photo/my-images/233/tagperftagfile7021.jpg/
  * 7.0.trunk : 
 http://imageshack.us/photo/my-images/52/tagperftagfile70trunk.jpg/
 
 Tests were made with 
 http://localhost:8080/tagfilesperf/generated/edit-tagfile.jsp
 
 
 One more question though : 
 Do you think we can cache ValueExpression instances ?

The parsed expressions are already cached. I don't think there is any
scope for further caching here.

I'll take another look with the profiler just to be sure.

Mark

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



Re : Re : Re : Re : Performance issue in simpleTags and tagfiles

2011-09-08 Thread Adrian Gonzalez
 The parsed expressions are already cached. I don't think there is any scope 
 for further caching here.


Parsed expressions are cached as org.apache.el.parser.Node instances (in 
ExpressionBuilder#createNodeInternal) - if I understood correctly.
What I was think was to cache javax.el.ValueExpression instances, but not sure 
if it's correct to cache those instances (what's scope ?).

For instance, in a jsp compiled code, we have multiple calls 
to PageContextImpl.proprietaryEvaluate.
proprietaryEvaluate calls createValueExpression and getValue.

In a sample
* 28% of proprietaryEvaluate time is spent on createValueExpression, 
* 45% is spent on getValue




- Mail original -
De : Mark Thomas ma...@apache.org
À : Tomcat Users List users@tomcat.apache.org
Cc : 
Envoyé le : Jeudi 8 Septembre 2011 11h28
Objet : Re: Re : Re : Re : Performance issue in simpleTags and tagfiles

On 08/09/2011 09:59, Adrian Gonzalez wrote:
 Just downloaded JProfiler eval.
 
 Compared tagfile performance between 7.0.21 and 7.0.trunk (this one this time 
 : http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/)
 
 With your optimization, we achieve a 24% performance gain - nice ;) 
 
 Test         7.0.21    7.0.trunk
 tagfile       267ms      206ms
 
 You can see JConsole output
  * 7.0.21 : http://imageshack.us/photo/my-images/233/tagperftagfile7021.jpg/
  * 7.0.trunk : 
http://imageshack.us/photo/my-images/52/tagperftagfile70trunk.jpg/
 
 Tests were made with 
 http://localhost:8080/tagfilesperf/generated/edit-tagfile.jsp
 
 
 One more question though : 
 Do you think we can cache ValueExpression instances ?

The parsed expressions are already cached. I don't think there is any
scope for further caching here.

I'll take another look with the profiler just to be sure.

Mark

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

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



Re: Re : Re : Re : Re : Performance issue in simpleTags and tagfiles

2011-09-08 Thread Mark Thomas
On 08/09/2011 10:40, Adrian Gonzalez wrote:
 The parsed expressions are already cached. I don't think there is
 any scope for further caching here.
 
 
 Parsed expressions are cached as org.apache.el.parser.Node instances
 (in ExpressionBuilder#createNodeInternal) - if I understood
 correctly.

Correct.

 What I was think was to cache javax.el.ValueExpression
 instances, but not sure if it's correct to cache those instances
 (what's scope ?).

This isn't the biggest delay in my profiling (I use YourKit) whether I
use sampling or tracing which just goes to show how much variation you
can get from system to system and with different profilers. In my
results, annotation scanning is still an issue for postConstruct /
preDestroy. Enhancing the caching to handle these as well gives the
following (with profiling disabled):

The figures I saw were:
TestOP  Me  Cached  Cached2
tagfile 500 328 203 125
classic 100 141 156 141
simple  500 250 156 125
none94  140 156 141

I've added that caching to trunk and tc7.0.x/trunk.

With that problem fixed, the sampling and tracing show very different
results which suggests to me that the tracing overhead is starting to
dominate the results.

 For instance, in a jsp compiled code, we have multiple calls to
 PageContextImpl.proprietaryEvaluate. proprietaryEvaluate calls
 createValueExpression and getValue.
 
 In a sample * 28% of proprietaryEvaluate time is spent on
 createValueExpression, * 45% is spent on getValue

The results of getValue can't be cached since the values of the resolved
attributes may change between invocations.

It should be possible to cache the ValueExpression per JSP page (in the
PageContext) but I am not sure how much that will gain you. We may be
into the realm of improving the results of a micro benchmark rather than
generally improving performance. I'll take a look.

Mark

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



Re : Re : Re : Re : Re : Performance issue in simpleTags and tagfiles

2011-09-08 Thread Adrian Gonzalez
Thanks Mark !

 It should be possible to cache the ValueExpression per JSP page (in 
 the PageContext)

Yes, but the PageContext life's span is more or less a user request, no ?
In this case, ValueExpression caching will only be usefull when exactly the 
same expression is used multiple times in the same JSP. And I agree that we are 
improving there a micro-benchmark.

What I was thinking was more about caching ValueExpression per class of JSP 
(i.e. one cache for edit_002dclassictag_jsp.java) - the cache being shared by 
all users of the application.

WDYT ?


- Mail original -
De : Mark Thomas ma...@apache.org
À : Tomcat Users List users@tomcat.apache.org
Cc : 
Envoyé le : Jeudi 8 Septembre 2011 13h09
Objet : Re: Re : Re : Re : Re : Performance issue in simpleTags and tagfiles

On 08/09/2011 10:40, Adrian Gonzalez wrote:
 The parsed expressions are already cached. I don't think there is
 any scope for further caching here.
 
 
 Parsed expressions are cached as org.apache.el.parser.Node instances
 (in ExpressionBuilder#createNodeInternal) - if I understood
 correctly.

Correct.

 What I was think was to cache javax.el.ValueExpression
 instances, but not sure if it's correct to cache those instances
 (what's scope ?).

This isn't the biggest delay in my profiling (I use YourKit) whether I
use sampling or tracing which just goes to show how much variation you
can get from system to system and with different profilers. In my
results, annotation scanning is still an issue for postConstruct /
preDestroy. Enhancing the caching to handle these as well gives the
following (with profiling disabled):

The figures I saw were:
Test    OP      Me      Cached  Cached2
tagfile 500     328     203     125
classic 100     141     156     141
simple  500     250     156     125
none    94      140     156     141

I've added that caching to trunk and tc7.0.x/trunk.

With that problem fixed, the sampling and tracing show very different
results which suggests to me that the tracing overhead is starting to
dominate the results.

 For instance, in a jsp compiled code, we have multiple calls to
 PageContextImpl.proprietaryEvaluate. proprietaryEvaluate calls
 createValueExpression and getValue.
 
 In a sample * 28% of proprietaryEvaluate time is spent on
 createValueExpression, * 45% is spent on getValue

The results of getValue can't be cached since the values of the resolved
attributes may change between invocations.

It should be possible to cache the ValueExpression per JSP page (in the
PageContext) but I am not sure how much that will gain you. We may be
into the realm of improving the results of a micro benchmark rather than
generally improving performance. I'll take a look.

Mark

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

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



Re: Re : Re : Re : Re : Re : Performance issue in simpleTags and tagfiles

2011-09-08 Thread Mark Thomas
On 08/09/2011 12:19, Adrian Gonzalez wrote:
 Thanks Mark !
 
 It should be possible to cache the ValueExpression per JSP page (in the 
 PageContext)
 
 Yes, but the PageContext life's span is more or less a user request, no ?

Correct. I should have said via the PageContext since that is all that
is available at the point where the cache would be used.

 In this case, ValueExpression caching will only be useful when exactly the 
 same expression is used multiple times in the same JSP. And I agree that we 
 are improving there a micro-benchmark.
 
 What I was thinking was more about caching ValueExpression per class of JSP 
 (i.e. one cache for edit_002dclassictag_jsp.java) - the cache being shared by 
 all users of the application.

Agreed.

 WDYT ?

I think it is worth a try. I tried it and saw no improvement. If there
was going to be any benefit then this use case is where I'd expect to
see it so I think we can conclude there is little more to be done here.
It appears the overhead of the cache is roughly the same as the overhead
of creating the value expression (or both are so small that other
factors are dominating).

Mark

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



Re : Re : Re : Re : Re : Re : Performance issue in simpleTags and tagfiles

2011-09-08 Thread Adrian Gonzalez
Thanks very much Mark for all the work on this issue !

Do you know which version of tomcat will contain the improvements you've made ?
 
- Mail original -
De : Mark Thomas ma...@apache.org
À : Tomcat Users List users@tomcat.apache.org
Cc : 
Envoyé le : Jeudi 8 Septembre 2011 14h24
Objet : Re: Re : Re : Re : Re : Re : Performance issue in simpleTags and 
tagfiles

On 08/09/2011 12:19, Adrian Gonzalez wrote:
 Thanks Mark !
 
 It should be possible to cache the ValueExpression per JSP page (in the 
 PageContext)
 
 Yes, but the PageContext life's span is more or less a user request, no ?

Correct. I should have said via the PageContext since that is all that
is available at the point where the cache would be used.

 In this case, ValueExpression caching will only be useful when exactly the 
 same expression is used multiple times in the same JSP. And I agree that we 
 are improving there a micro-benchmark.
 
 What I was thinking was more about caching ValueExpression per class of JSP 
 (i.e. one cache for edit_002dclassictag_jsp.java) - the cache being shared by 
 all users of the application.

Agreed.

 WDYT ?

I think it is worth a try. I tried it and saw no improvement. If there
was going to be any benefit then this use case is where I'd expect to
see it so I think we can conclude there is little more to be done here.
It appears the overhead of the cache is roughly the same as the overhead
of creating the value expression (or both are so small that other
factors are dominating).

Mark

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

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



Re: Re : Re : Re : Re : Re : Re : Performance issue in simpleTags and tagfiles

2011-09-08 Thread Mark Thomas
On 08/09/2011 13:50, Adrian Gonzalez wrote:
 Thanks very much Mark for all the work on this issue !
 
 Do you know which version of tomcat will contain the improvements you've made 
 ?

7.0.22 onwards.

Mark

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



Performance issue in simpleTags and tagfiles

2011-09-07 Thread Adrian Gonzalez
Hello,

I've noticed a performance difference between classic Tags and simple Tags in 
Tomcat 7.0.21 (also tested it on 7.0.6 with the same results).

Simple tags or tagfiles execution is at 5 times superior to classic tag 
execution.

Classic tag execution is more or less the same than using no tags at all.

This impacts web applications relying heavily on custom tag files (such as 
Spring ROO generated applications).
Overall performance with / without tag files is ratio 3 (including JDBC calls, 
etc...)

I've created a maven project to reproduce the issue.

* tagfile performance [elapsed = 500 ms].
URL = http://localhost:8080/tagfilesperf/edit-tagfile.jsp
* classic tag performance [elapsed = 100 ms].
http://localhost:8080/tagfilesperf/edit-classictag.jsp
* simple tag performance [elapsed = 500 ms].
http://localhost:8080/tagfilesperf/edit-simpletag.jsp
* notag performance [elapsed = 94 ms].
http://localhost:8080/tagfilesperf/edit-notag.jsp


Project is available in Spring Forum 
(http://forum.springsource.org/attachment.php?attachmentid=4227d=1315397882).
I cannot send it with email for the moment (some network restriction policy 
here - sorry).
More info about this issue is available 
here http://forum.springsource.org/showthread.php?114210-Roo-tagfiles-performance-issuesp=378862#post378862

Should I create an issue in bugzilla or did I miss something ?

Thanks for the help !

Re: Performance issue in simpleTags and tagfiles

2011-09-07 Thread Remy Maucherat
On Wed, Sep 7, 2011 at 2:23 PM, Adrian Gonzalez adr_gonza...@yahoo.fr wrote:
 Hello,

 I've noticed a performance difference between classic Tags and simple Tags in 
 Tomcat 7.0.21 (also tested it on 7.0.6 with the same results).

 Simple tags or tagfiles execution is at 5 times superior to classic tag 
 execution.

Simple tags (and derivatives) are easier to write, but are not
poolable. So regular tags are best if you're going to use them a lot.

Rémy

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



Re : Performance issue in simpleTags and tagfiles

2011-09-07 Thread Adrian Gonzalez
I understand it, but it's reasonable to pay 20% CPU more (on code executed on 
JSP side - not overall code). Here the difference is *5.

It appears to me a bit more than originally intended, don't you think ?

I'm new on tag files, so perhaps as you said it's just a feature for quick 
prototyping or for tags seldom in the application used (but in this case it's 
rather weird).

- Mail original -
De : Remy Maucherat remy.mauche...@gmail.com
À : Tomcat Users List users@tomcat.apache.org
Cc : 
Envoyé le : Mercredi 7 Septembre 2011 16h57
Objet : Re: Performance issue in simpleTags and tagfiles

On Wed, Sep 7, 2011 at 2:23 PM, Adrian Gonzalez adr_gonza...@yahoo.fr wrote:
 Hello,

 I've noticed a performance difference between classic Tags and simple Tags in 
 Tomcat 7.0.21 (also tested it on 7.0.6 with the same results).

 Simple tags or tagfiles execution is at 5 times superior to classic tag 
 execution.

Simple tags (and derivatives) are easier to write, but are not
poolable. So regular tags are best if you're going to use them a lot.

Rémy

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

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



Re: Performance issue in simpleTags and tagfiles

2011-09-07 Thread Mark Thomas
On 07/09/2011 15:57, Remy Maucherat wrote:
 On Wed, Sep 7, 2011 at 2:23 PM, Adrian Gonzalez adr_gonza...@yahoo.fr wrote:
 Hello,

 I've noticed a performance difference between classic Tags and simple Tags 
 in Tomcat 7.0.21 (also tested it on 7.0.6 with the same results).

 Simple tags or tagfiles execution is at 5 times superior to classic tag 
 execution.
 
 Simple tags (and derivatives) are easier to write, but are not
 poolable. So regular tags are best if you're going to use them a lot.

+1

A look with a profiler shows that a fair amount of time is spend in the
InstanceManager with the non-poolable tags. We could probably speed that
up with some caching.

I'll take a look to see if the benefit is worth the complexity.

Mark

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



Re : Performance issue in simpleTags and tagfiles

2011-09-07 Thread Adrian Gonzalez
Thanks for taking your time to look this issue !

- Mail original -
De : Mark Thomas ma...@apache.org
À : Tomcat Users List users@tomcat.apache.org
Cc : 
Envoyé le : Mercredi 7 Septembre 2011 19h13
Objet : Re: Performance issue in simpleTags and tagfiles

On 07/09/2011 15:57, Remy Maucherat wrote:
 On Wed, Sep 7, 2011 at 2:23 PM, Adrian Gonzalez adr_gonza...@yahoo.fr wrote:
 Hello,

 I've noticed a performance difference between classic Tags and simple Tags 
 in Tomcat 7.0.21 (also tested it on 7.0.6 with the same results).

 Simple tags or tagfiles execution is at 5 times superior to classic tag 
 execution.
 
 Simple tags (and derivatives) are easier to write, but are not
 poolable. So regular tags are best if you're going to use them a lot.

+1

A look with a profiler shows that a fair amount of time is spend in the
InstanceManager with the non-poolable tags. We could probably speed that
up with some caching.

I'll take a look to see if the benefit is worth the complexity.

Mark

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

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



Re: Re : Performance issue in simpleTags and tagfiles

2011-09-07 Thread Mark Thomas
On 07/09/2011 18:37, Adrian Gonzalez wrote:
 Thanks for taking your time to look this issue !

Adding a cache for annotation scanning (that was taking most of the
time) was relatively simple. Are you willing to build Tomcat 7.0.x from
source and see if the new cache works for you?

Mark

 - Mail original -
 De : Mark Thomas ma...@apache.org
 À : Tomcat Users List users@tomcat.apache.org
 Cc : 
 Envoyé le : Mercredi 7 Septembre 2011 19h13
 Objet : Re: Performance issue in simpleTags and tagfiles
 
 On 07/09/2011 15:57, Remy Maucherat wrote:
 On Wed, Sep 7, 2011 at 2:23 PM, Adrian Gonzalez adr_gonza...@yahoo.fr 
 wrote:
 Hello,

 I've noticed a performance difference between classic Tags and simple Tags 
 in Tomcat 7.0.21 (also tested it on 7.0.6 with the same results).

 Simple tags or tagfiles execution is at 5 times superior to classic tag 
 execution.

 Simple tags (and derivatives) are easier to write, but are not
 poolable. So regular tags are best if you're going to use them a lot.
 
 +1
 
 A look with a profiler shows that a fair amount of time is spend in the
 InstanceManager with the non-poolable tags. We could probably speed that
 up with some caching.
 
 I'll take a look to see if the benefit is worth the complexity.
 
 Mark
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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



Re : Re : Performance issue in simpleTags and tagfiles

2011-09-07 Thread Adrian Gonzalez
Ouch, that was fast ! Thanks very much !

Are you willing to build Tomcat 7.0.x from source and see if the new cache 
works for you?

- Of course ! Donno if I'm doing it now or tomorrow morning though - I'm a bit 
ill at the moment ;(
sources are in trunk, right ? (http://svn.apache.org/repos/asf/tomcat/trunk/) 


- Mail original -
De : Mark Thomas ma...@apache.org
À : Tomcat Users List users@tomcat.apache.org
Cc : 
Envoyé le : Mercredi 7 Septembre 2011 20h36
Objet : Re: Re : Performance issue in simpleTags and tagfiles

On 07/09/2011 18:37, Adrian Gonzalez wrote:
 Thanks for taking your time to look this issue !

Adding a cache for annotation scanning (that was taking most of the
time) was relatively simple. Are you willing to build Tomcat 7.0.x from
source and see if the new cache works for you?

Mark

 - Mail original -
 De : Mark Thomas ma...@apache.org
 À : Tomcat Users List users@tomcat.apache.org
 Cc : 
 Envoyé le : Mercredi 7 Septembre 2011 19h13
 Objet : Re: Performance issue in simpleTags and tagfiles
 
 On 07/09/2011 15:57, Remy Maucherat wrote:
 On Wed, Sep 7, 2011 at 2:23 PM, Adrian Gonzalez adr_gonza...@yahoo.fr 
 wrote:
 Hello,

 I've noticed a performance difference between classic Tags and simple Tags 
 in Tomcat 7.0.21 (also tested it on 7.0.6 with the same results).

 Simple tags or tagfiles execution is at 5 times superior to classic tag 
 execution.

 Simple tags (and derivatives) are easier to write, but are not
 poolable. So regular tags are best if you're going to use them a lot.
 
 +1
 
 A look with a profiler shows that a fair amount of time is spend in the
 InstanceManager with the non-poolable tags. We could probably speed that
 up with some caching.
 
 I'll take a look to see if the benefit is worth the complexity.
 
 Mark
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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

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



Re : Re : Performance issue in simpleTags and tagfiles

2011-09-07 Thread Adrian Gonzalez
Sorry, no real difference.

Even worse, I'm on my home computer and here I don't see anymore the *5 
difference between simple tags and classic tags.

I'll continue these tests tomorrow at work (perhaps there's some file scanning 
/ reading in action - and since I'm with AV software...).

 - Tests results - 

Downloaded tomcat trunk sources 
from http://svn.apache.org/repos/asf/tomcat/trunk/

Used sample project 
here http://forum.springsource.org/attachment.php?attachmentid=4227d=1315397882
 from this 
issue http://forum.springsource.org/showthread.php?114210-Roo-tagfiles-performance-issues.


There are 4 different jsps in the test (one using tagfile, one using classic 
tag, etc...).
Each one does 1000 loops and prints overall elapsed time.
//timer.start
c:forEach begin=1 end=1
  appfield:inputS label=personne.nom field=personne.nom id=personne.nom 
value=THOMAS/
/c:forEach
//sysout timer.elapsed

Tomcat trunk
 * tagfile = 730
 * classictag = 730
 * simpletag = 740
 * notag = 730

Tomcat 7.0.21
 * tagfile = 700
 * classictag = 720
 * simpletag = 700
 * notag = 750



- Mail original -
De : Adrian Gonzalez adr_gonza...@yahoo.fr
À : Tomcat Users List users@tomcat.apache.org
Cc : 
Envoyé le : Mercredi 7 Septembre 2011 20h43
Objet : Re : Re : Performance issue in simpleTags and tagfiles

Ouch, that was fast ! Thanks very much !

Are you willing to build Tomcat 7.0.x from source and see if the new cache 
works for you?

- Of course ! Donno if I'm doing it now or tomorrow morning though - I'm a bit 
ill at the moment ;(
sources are in trunk, right ? (http://svn.apache.org/repos/asf/tomcat/trunk/) 


- Mail original -
De : Mark Thomas ma...@apache.org
À : Tomcat Users List users@tomcat.apache.org
Cc : 
Envoyé le : Mercredi 7 Septembre 2011 20h36
Objet : Re: Re : Performance issue in simpleTags and tagfiles

On 07/09/2011 18:37, Adrian Gonzalez wrote:
 Thanks for taking your time to look this issue !

Adding a cache for annotation scanning (that was taking most of the
time) was relatively simple. Are you willing to build Tomcat 7.0.x from
source and see if the new cache works for you?

Mark

 - Mail original -
 De : Mark Thomas ma...@apache.org
 À : Tomcat Users List users@tomcat.apache.org
 Cc : 
 Envoyé le : Mercredi 7 Septembre 2011 19h13
 Objet : Re: Performance issue in simpleTags and tagfiles
 
 On 07/09/2011 15:57, Remy Maucherat wrote:
 On Wed, Sep 7, 2011 at 2:23 PM, Adrian Gonzalez adr_gonza...@yahoo.fr 
 wrote:
 Hello,

 I've noticed a performance difference between classic Tags and simple Tags 
 in Tomcat 7.0.21 (also tested it on 7.0.6 with the same results).

 Simple tags or tagfiles execution is at 5 times superior to classic tag 
 execution.

 Simple tags (and derivatives) are easier to write, but are not
 poolable. So regular tags are best if you're going to use them a lot.
 
 +1
 
 A look with a profiler shows that a fair amount of time is spend in the
 InstanceManager with the non-poolable tags. We could probably speed that
 up with some caching.
 
 I'll take a look to see if the benefit is worth the complexity.
 
 Mark
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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

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

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



Re : Re : Performance issue in simpleTags and tagfiles

2011-09-07 Thread Adrian Gonzalez
One more test at home (usin Sun Jdk 1.6.23).

Results are in nanosecond and correspond to generated JSP pages (loop with 1000 
iteration is replaced with 1000 tags).

With this test I have simpleTag = 10 * classicTag.
An this ratio is the same in 7.0.21 or in trunk.

trunk
simple = 13461836 
[http://localhost:8080/tagfilesperf/generated/edit-simpletag.jsp]
classic=    1491251 
[http://localhost:8080/tagfilesperf/generated/edit-classictag.jsp]
tagfile=   13660309 
[http://localhost:8080/tagfilesperf/generated/edit-tagfile.jsp]

7.0.21
simple = 12590453
classic =   1388338
tagfile =  15088080

More tomorrow, sorry to spam...

- Mail original -
De : Adrian Gonzalez adr_gonza...@yahoo.fr
À : Tomcat Users List users@tomcat.apache.org
Cc : 
Envoyé le : Mercredi 7 Septembre 2011 21h36
Objet : Re : Re : Performance issue in simpleTags and tagfiles

Sorry, no real difference.

Even worse, I'm on my home computer and here I don't see anymore the *5 
difference between simple tags and classic tags.

I'll continue these tests tomorrow at work (perhaps there's some file scanning 
/ reading in action - and since I'm with AV software...).

 - Tests results - 

Downloaded tomcat trunk sources 
from http://svn.apache.org/repos/asf/tomcat/trunk/

Used sample project 
here http://forum.springsource.org/attachment.php?attachmentid=4227d=1315397882
 from this 
issue http://forum.springsource.org/showthread.php?114210-Roo-tagfiles-performance-issues.


There are 4 different jsps in the test (one using tagfile, one using classic 
tag, etc...).
Each one does 1000 loops and prints overall elapsed time.
//timer.start
c:forEach begin=1 end=1
  appfield:inputS label=personne.nom field=personne.nom id=personne.nom 
value=THOMAS/
/c:forEach
//sysout timer.elapsed

Tomcat trunk
 * tagfile = 730
 * classictag = 730
 * simpletag = 740
 * notag = 730

Tomcat 7.0.21
 * tagfile = 700
 * classictag = 720
 * simpletag = 700
 * notag = 750



- Mail original -
De : Adrian Gonzalez adr_gonza...@yahoo.fr
À : Tomcat Users List users@tomcat.apache.org
Cc : 
Envoyé le : Mercredi 7 Septembre 2011 20h43
Objet : Re : Re : Performance issue in simpleTags and tagfiles

Ouch, that was fast ! Thanks very much !

Are you willing to build Tomcat 7.0.x from source and see if the new cache 
works for you?

- Of course ! Donno if I'm doing it now or tomorrow morning though - I'm a bit 
ill at the moment ;(
sources are in trunk, right ? (http://svn.apache.org/repos/asf/tomcat/trunk/) 


- Mail original -
De : Mark Thomas ma...@apache.org
À : Tomcat Users List users@tomcat.apache.org
Cc : 
Envoyé le : Mercredi 7 Septembre 2011 20h36
Objet : Re: Re : Performance issue in simpleTags and tagfiles

On 07/09/2011 18:37, Adrian Gonzalez wrote:
 Thanks for taking your time to look this issue !

Adding a cache for annotation scanning (that was taking most of the
time) was relatively simple. Are you willing to build Tomcat 7.0.x from
source and see if the new cache works for you?

Mark

 - Mail original -
 De : Mark Thomas ma...@apache.org
 À : Tomcat Users List users@tomcat.apache.org
 Cc : 
 Envoyé le : Mercredi 7 Septembre 2011 19h13
 Objet : Re: Performance issue in simpleTags and tagfiles
 
 On 07/09/2011 15:57, Remy Maucherat wrote:
 On Wed, Sep 7, 2011 at 2:23 PM, Adrian Gonzalez adr_gonza...@yahoo.fr 
 wrote:
 Hello,

 I've noticed a performance difference between classic Tags and simple Tags 
 in Tomcat 7.0.21 (also tested it on 7.0.6 with the same results).

 Simple tags or tagfiles execution is at 5 times superior to classic tag 
 execution.

 Simple tags (and derivatives) are easier to write, but are not
 poolable. So regular tags are best if you're going to use them a lot.
 
 +1
 
 A look with a profiler shows that a fair amount of time is spend in the
 InstanceManager with the non-poolable tags. We could probably speed that
 up with some caching.
 
 I'll take a look to see if the benefit is worth the complexity.
 
 Mark
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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

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

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

Re: Re : Re : Performance issue in simpleTags and tagfiles

2011-09-07 Thread Mark Thomas
On 07/09/2011 20:36, Adrian Gonzalez wrote:
 Sorry, no real difference.
 
 Even worse, I'm on my home computer and here I don't see anymore the *5 
 difference between simple tags and classic tags.

The figures I saw were:
TestOP  Me  Cached
tagfile 500 328 203
classic 100 141 156
simple  500 250 156
none94  140 156

A slight increase in the case where the cache isn't used and a
reasonable improvement in the other cases.

Performance tuning is always going to be system dependent. In this case
I think there us enough evidence to justify putting in the cache - even
if this is effectively a micro benchmark.

 I'll continue these tests tomorrow at work (perhaps there's some file 
 scanning / reading in action - and since I'm with AV software...).

I'd be very interested to see those results.

  - Tests results - 
 
 Downloaded tomcat trunk sources from 
 http://svn.apache.org/repos/asf/tomcat/trunk/

That is actually 8.0.x but there is currently very little difference
between that an 7.0.x with is at:
http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/

Cheers,

Mark

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