Christian
Christian

Reputation: 1706

Howto dig for performance problems with moxy

I'm using moxy for large structure and in 95% of cases it works like charme. It is fast and reliable. But I do have now a project with the same class structure but different data. Now I do have a big read impact. Writing the complete project needs ~20sec, but reading needs more than 450sec. The written file is around 280MB. (Usally reading is only 30% slower)

With guessing I wasn't able to find the problem. But how to dig for this problem in moxy.

The first thing I tried was to supply a different Reader (BufferedInputStream, FileInputStream and just the file) nothing changed. Than I checked the XmlJavaTypeAdapter and set the defaultSize of maps etc. Again nothing changed.

So maybe someone has a better idea.

[UPDATE 1]

After extracting all osgi parts and building a standalone java application I was able to use VisualVM for analyzing this project. And I found that ReferenceResolver.getReference() consumes more than 90%. So I guess my Reference and ID is somehow badly designed.

[UPDATE 2]

Created an issue

Upvotes: 0

Views: 134

Answers (1)

marcelv3612
marcelv3612

Reputation: 663

You discovered a performance bug.

It was addressed and the algorithm has been changed, decreasing time complexity roughly by n (size of input). Should be pretty fast now. May moxy charm you in 100 % of cases.

Thanks for the contribution.

Upvotes: 1

Related Questions