G
Giovanni Azua
Hi all,
I was busy today doing some micro-benchmark performance testing to the
[revised and optimized] PerfectJPattern's Visitor implementation and wanted
to ask for advice if anything could be improved here.
The benchmark is implemented as a Test Case like this:
http://perfectjpattern.svn.sourcefo...oral/visitor/TestPerformance.java?view=markup
The class being benchmarked is the following:
http://perfectjpattern.svn.sourcefo...oral/visitor/AbstractVisitor.java?view=markup
Model class (requires parameter covariance matching):
http://perfectjpattern.svn.sourcefo...ehavioral/visitor/StyledBody.java?view=markup
Visitors:
(without caching)
http://perfectjpattern.svn.sourcefo...behavioral/visitor/DoVisitor.java?view=markup
(with caching)
http://perfectjpattern.svn.sourcefo...avioral/visitor/PrintVisitor.java?view=markup
I run the test case separately from command line like this:
$
mvn -DargLine="-XX:+PrintCompilation -verbose:gc -Xbatch -XX:CICompilerCount=1
-Xms256m -Xmx512m" -Dtest=TestPerformance test
I consistently get results like the following:
***************************************************
TestPerformance Classical took '859.0' millis
TestPerformance PerfectJPattern's without caching took '1735.0' millis
***************************************************
***************************************************
INFO TestPerformance Classical took '812.0' millis
INFO TestPerformance PerfectJPattern's with caching took '875.0' millis
***************************************************
The classical version does two separate dispatches same as in manual Visitor
implementations.
The perfectjpattern's version emulates double-dispatch on top of a Delegate.
if you want to run the test you can do so by checking out the code like
this:
$ svn checkout
https://perfectjpattern.svn.sourceforge.net/svnroot/perfectjpattern/trunk
perfectjpattern
Thanks in advance,
Best regards,
Giovanni
I was busy today doing some micro-benchmark performance testing to the
[revised and optimized] PerfectJPattern's Visitor implementation and wanted
to ask for advice if anything could be improved here.
The benchmark is implemented as a Test Case like this:
http://perfectjpattern.svn.sourcefo...oral/visitor/TestPerformance.java?view=markup
The class being benchmarked is the following:
http://perfectjpattern.svn.sourcefo...oral/visitor/AbstractVisitor.java?view=markup
Model class (requires parameter covariance matching):
http://perfectjpattern.svn.sourcefo...ehavioral/visitor/StyledBody.java?view=markup
Visitors:
(without caching)
http://perfectjpattern.svn.sourcefo...behavioral/visitor/DoVisitor.java?view=markup
(with caching)
http://perfectjpattern.svn.sourcefo...avioral/visitor/PrintVisitor.java?view=markup
I run the test case separately from command line like this:
$
mvn -DargLine="-XX:+PrintCompilation -verbose:gc -Xbatch -XX:CICompilerCount=1
-Xms256m -Xmx512m" -Dtest=TestPerformance test
I consistently get results like the following:
***************************************************
TestPerformance Classical took '859.0' millis
TestPerformance PerfectJPattern's without caching took '1735.0' millis
***************************************************
***************************************************
INFO TestPerformance Classical took '812.0' millis
INFO TestPerformance PerfectJPattern's with caching took '875.0' millis
***************************************************
The classical version does two separate dispatches same as in manual Visitor
implementations.
The perfectjpattern's version emulates double-dispatch on top of a Delegate.
if you want to run the test you can do so by checking out the code like
this:
$ svn checkout
https://perfectjpattern.svn.sourceforge.net/svnroot/perfectjpattern/trunk
perfectjpattern
Thanks in advance,
Best regards,
Giovanni