Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance problem for XMLGregorianCalendar caused by ConstructionStrategies #777

Closed
amohrig opened this issue Dec 17, 2019 · 0 comments
Closed

Comments

@amohrig
Copy link
Contributor

amohrig commented Dec 17, 2019

Whats your runtime?

  • Dozer version: 6.2 - 6.5
  • OS version: Windows, Linux
  • JDK version: 8 - 11

Whats the problem?

We are using Dozer to map object trees resulting from a JAXB deserialization of XML documents containing lots of XMLGregorianCalendar values.
While processing large numbers of such objects (in the magnitude of tens of millions) we noticed that a lot of time is spent in calls to DatatypeFactory.newInstance() being issued from ConstructionStrategies.

Observed Results:

The inner class XmlGregorian in com.github.dozermapper.core.factory.ConstructionStrategies is creating a new instance of DatatypeFactory for each XMLGregorianCalendar object it is asked to create via calls to create(BeanCreationDirective directive).

Expected Results:

The overhead should be avoided so that creating XMLGregorianCalendar objects to map into remains reasonably cheap.

Link to GitHub repo with fix

We will provide a fix via https://github.com/kuehne-nagel/dozer/tree/datatypefactory and a pull request from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants