java - JAXBContext initialization speedup? -
Any way to accelerate starting with a large (> 1000) number of javax.xml.bind.JAXBContexts Is the classes? The startup time in our XML heavy application is a few 10 minutes and mainly consists of the initial time of JACXOTX. : - (
We are using the org.jvnet.jaxb2.maven2.maven-jaxb2-plugin for JAASB implementation of the Sun in JDK 1.5 and code generation from XSD.
JXAB reference implementation There is a non-undocumented system property for this reason exactly:
-Dcom.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.fastboot = true or prior versions of the package before refining:
-Dcom.sun.xml.bind.v2.runtime.JAXBContextImpl.fastboot = true This is not to allow JAXB to leave EA Rdesh does need to employ inexpensive process of pre-caching the muscles of various reflections. Instead, when context is used, then it will reflect all. It runs a slow runtime, but quite a fast introduction, especially for large numbers of classes.
However, a part of the motion problem is indispensable, and the fact is that JAXB has slowed down its classes, and the classmoding is clear that if you have a second reference immediately after the same configuration - you will see that it is too much, very fast, classes are already loaded.
In addition, you say that you have multiple references due to multiple JAXBCOntext examples. Do you know that you can put multiple reference paths in a context? When you start the context, you have to pass them all as a semicolon-delimited string, e.g.
JaxbContext.newInstance ("a.b.c: x.y.z"); will load the reference a.b.c and x.y.z . This possibility will not make any difference in performance, however.
Comments
Post a Comment