Pages

Friday, May 18, 2012

How to speed up annotation processing in WAS V7/V8


There are a number of options to speed up annotations processing -
Those are mentioned in this technote...

1. Specify ​metadata-complete="true"​ in the Deployment Descriptor.  This means that NO annotation scanning will take place.

2. Move 3rd party jars that don't need to be scanned for annotations outside of the EAR into a Shared Lib,

3. Specify 3rd party jars  (from Spring and Hibernate) in the amm.filter.properties file.
http://www-304.ibm.com/support/docview.wss?rs=180&uid=swg1PK87053

4. Utilize echniques listed in the blog post on Performance considerations for deploying very large Java Enterprise Edition (JEE) applications
http://wasdynacache.blogspot.com/2011/05/websphere-application-server.html

5. Reducing annotation searches during application deployment
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.doc%2Finfo%2Fae%2Fae%2Ftrun_app_reduce_annot.html


6. org.eclipse.jst.j2ee.commonarchivecore.FILTERBINARIES  - A custom property that provides a list of files and directories that should not be processed as a part of the server start process.


Gory details

http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.doc%2Finfo%2Fae%2Fae%2Fxrun_jvm.html

com.ibm.ws.amm.scan.context.filter.archives


Use this property to provide a list of archives, or utility JAR files, that do not contain annotations. Archives or utility JAR files specified for this property are not be scanned for annotations.
When a Java Platform, Enterprise Edition (Java EE) 5 or 6 application is deployed or updated, the Annotations Metadata Manager (AMM) facility scans all of the annotation metadata. This scanning process can negatively affect the amount of time required to deploy an application. If the application includes archives or utilities that do not contain annotations, you can list these archives and utilities as the value for this property. If the application includes Java Packages that do not contain annotations, you can list them as the value for the Ignore-Scanning-Packages property.
The values specified for this properties are case sensitive, and must be expressed as a single string with a comma followed by a space used to separate the names of the archives or utility JAR files. Wildcards and REGEX expressions are not permitted.
As an alternative to using this custom property, you can add the Ignore-Scanning-Archives property to one of the following files or modules, and specify the archives and utilities that you do not want scanned as the value of that property:
  • The amm.filter.properties file that is located in the was_home/properties directory.
  • The amm.filter.properties file that is located in the profile_home/properties directory
  • The manifest file of an application, META-INF/MANIFEST.MF
  • The manifest of a web or Enterprise JavaBeans (EJB) module within an application
Values specified in the amm.filter.properties files are merged with those found in this custom property to form a server scoped set of filters. This merged set of filters applies to all of the applications that are deployed on that server.
Values specified in the manifest file of an application are merged with the server scoped set of filters to form a module scoped superset that applies to all modules within that application.
Values specified in the manifest file of a web or Enterprise JavaBeans (EJB) module are merged with the module scoped set of filters. This merged set of filters only applies to that module.
Avoid trouble Avoid trouble: Exercise caution if you update a manifest file. Manifest files have line length limitations, and other constraints that must be adhered to.
Example:
Ignore-Scanning-Archives : ant.jar,  avalon-framework-4.2.0.jar, axis.jar, CICS.jar, xerces.jar

com.ibm.ws.amm.scan.context.filter.packages.


Use this property to provide a list of Java Packages that do not contain annotations. The Java classes specified for this property are not scanned for annotations.
When a Java Platform, Enterprise Edition (Java EE) 5 or 6 application is deployed or updated, the Annotations Metadata Manager (AMM) facility scans all of the annotation metadata. This scanning process can negatively affect the amount of time required to deploy an application. If the application includes Java Packages that do not contain annotations, you can list them as the value for this property. If the application includes archives or utilities that do not contain annotations, you can list them as the value for the Ignore-Scanning-Archives property.
The value specified for this property are case sensitive and must be expressed as a single string with a comma followed by a space used to separate the names of the Java Packages. Wildcards and REGEX expressions are not permitted.
As an alternative to using this custom property, you can add the Ignore-Scanning-Packages property to one of the following files or modules, and specify the archives and utilities that you do not want scanned as the value of that property:
  • The amm.filter.properties file that is located in the was_home/properties directory
  • The amm.filter.properties file that is located in the profile_home/properties directory
  • The manifest file of an application, META-INF/MANIFEST.MF
  • The manifest of a web or Enterprise JavaBeans (EJB) module within an application
Values specified in the amm.filter.properties files are merged with those found in this custom property to form a server scoped set of filters. This merged set of filters applies to all of the applications that are deployed on that server.
Values specified in the manifest file of an application are merged with the server scoped set of filters to form a module scoped superset that applies to all modules within that application.
Values specified in the manifest file of a web or Enterprise JavaBeans (EJB) module are merged with the module scoped set of filters. This merged set of filters only applies to that module.
Avoid trouble Avoid trouble: The following example is properties file centric and cannot be used as is for a manifest file. Manifest files have a 72 byte line length limit, as well as other constraints that must be adhered to.
Example:
Ignore-Scanning-Packages : org.apache.avalon, org.apache.batik, org.apache.commons

com.ibm.ws.application.enhancedScanning

Use this property to disable several optimizations that decreases the time to deploy and start enterprise applications. The optimizations primarily involve Java Platform, Enterprise Edition (Java EE 5)-enabled applications. When you set this property to false, the following updates are disabled:
  • A new cache for modules files
  • A new cache for module classloading
  • Alternate code paths for annotation processing.
If you set this property to false, you might experience decreases in performance. Thus, by default, this property value is set to true

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.