Skip to main content

What does com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize do?

4 replies [Last post]
oisin_hurley
Offline
Joined: 2003-06-23
Points: 0

Due to classloader constraints when loading JAXB generated code into
an OSGi bundle, we've had to set this magic property to true, preventing
the reference impl from force-feeding a class (via defineClass) into a
classloader that already has the class defined.

Thing is, we don't know what the side-effects may be. I think it might
just cause things to slow down ever so slightly, but is there more to it?

regards
--oh

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miguelm
Offline
Joined: 2005-03-17
Points: 0

I've found that this helps with launching debuggers. I've sometimes had a problem when launching a GUI application from my IDE. It often hangs before reaching the main window. It happens under both IntelliJ and NetBeans, although it may happen with others, too. But when I launch with this property set to true, the debugger never hangs. I don't know why. Does anyone know what's going on?

rebeccas
Offline
Joined: 2005-09-06
Points: 0

No, it is an optimization only feature.

dandiep
Offline
Joined: 2005-08-17
Points: 0

Any word on how much this slows things down?

kohsuke
Offline
Joined: 2003-06-09
Points: 0

We don't really measure it, so I don't know for sure actually.

But unless you are in the server environment or something where the sustained unmarshalling performance is important, I wouldn't worry about it.

If you are unmarshalling XML just once or twice, then this might even be a win, because of the reduced time it takes to set up JAXBContext.