質問

There is a class that is annotated with JAXB's @XmlRootElement, but there are some flows which doesn't exploit this annotation and which require high performance. Is there a performance penalty in constructing objects from this class and setting fields as opposed to doing so with the same class without this annotation?

役に立ちましたか?

解決

There would be a small amount of memory used to store metadata related to a class being annotated with @XmlRootElement. The only runtime processing impact related to the presence of that annotation would be when bootstrapping the JAXBContext. There would be no impact on marshalling and unmarshalling.

他のヒント

If I understand correctly, no, an annotation is metadata attached to the Class object, not to instances of the class.

The annotation will in no way affect creating instances and invoking methods on them directly.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top