How do I improve performance of application that uses the JAXBContext.newInstance operation?

后端 未结 5 1125
太阳男子
太阳男子 2020-12-30 01:59

I use the JAXBContext.newInstance operation in my JBoss based web application. This operation, as I understand, is very heavyweight. I only require two unique instances of t

5条回答
  •  难免孤独
    2020-12-30 02:06

    I recently did some performance testing with JAXBContext.newInstance and the result is documented here .

    http://app-inf.blogspot.com/2012/10/performance-tuning-logging-right-way.html

    When called by one thread, using a fairly large schema with ~195 classes generated, it took ~400ms to finish. When called by 20 threads simultaneously, it caused cpu contentions, and took up to ~5000ms to finish. The creation of marshaller and object serialization of a small object only too ~14ms.

提交回复
热议问题