sonnv56 / xdocreport

Automatically exported from code.google.com/p/xdocreport
0 stars 0 forks source link

Slowdown #389

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello! Thank you for XDocReport.

What steps will reproduce the problem?
1. I have project where I use XDocReport fo generete report *.docx from 
template.
2. In my project for generete reports I use 3 classes (models).
3. Method fieldsMetadata.load("myClass", class) for one parent class (class 
Passport, see attachment) slows execute my application. It looks like a 
circular reference, but I not andestand what exactly happens.
4. Problem occurs only when parent class have two reference on list of children.
5. If I delete one list reference all work good - quickly. There are problems 
with just two subordinates lists.

What is the expected output? What do you see instead?
As a result, the report is generated, but after a few minutes.

What version of the product are you using? On what operating system?
XDocReport version 1.0.4

Please provide any additional information below.
Data model I put in an attachment.
In my application I call:
fieldsMetadata.load("passport", Passport.class);

Thanks,
    Ivan

Original issue reported on code.google.com by cimo...@gmail.com on 6 Apr 2014 at 10:38

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi,

I'm going to have a look. There must be an issue with circular relationship.

Beside, do you need bidirectional relationships are not usually a good idea. Do 
you really need bi-directionnal relation between your classes ?

best regards

Original comment by pascal.leclercq on 6 Apr 2014 at 9:07

GoogleCodeExporter commented 9 years ago
Can you please attach a sample docx that you use ?

This would help me.

Thx.

Original comment by pascal.leclercq on 7 Apr 2014 at 7:42

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi,

I experimented a little more. Found out that it's not list of chilfren reason 
deceleration. In my opinion the cause of my very complex data model. Very many 
bidirectional relationships and in original my model is hibernate entities i.e. 
we have more sophisticated annotations. Apparently slowing quite normal for 
your processing algorithm.

I attache full data model classes and template docx. Slowdown occurs when I 
call 
fieldsMetadata.load("passport", Passport.class);
Before document generation.

Best regards.

Original comment by cimo...@gmail.com on 8 Apr 2014 at 4:32

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

I can reproduce but I don't think we should fix this issue. Your model is too 
complex IMHO with a lot of circular references between classes. This lead us to 
24242 fields for fieldsMetadata and a huge 6 Mb  fieldsMetadata.xml 
file.

I think you should map your model to a simpler one dedicated to the report you 
want to produce and/or remove bidirectional relationships in your model.

Best regards

Original comment by pascal.leclercq on 8 Apr 2014 at 9:32

GoogleCodeExporter commented 9 years ago
At first I thought fieldsMetadata.load was necessary for the use of the model 
in the template, but then realized that enough use fieldsMetadata.addfild metod 
(I do not use a macro). I call it twice. For the entire model and its field 
list. This for my project is complete enough.

Thank you very much for your advice!

Best regards.

Original comment by cimo...@gmail.com on 9 Apr 2014 at 4:00

GoogleCodeExporter commented 9 years ago
Hi Pascal,

Many thank's for your investigation about this issue. I tell me, perhaps (if 
it's possible), we should throw an exception when there is too circular 
references :

 1) use a default max circular references value.
 2) customize this max value with FieldsMetadata#setMaxCircularReferences

What do you think about that?

Regards Angelo

Original comment by angelo.z...@gmail.com on 9 Apr 2014 at 5:09

GoogleCodeExporter commented 9 years ago
cleanup

Original comment by pascal.leclercq on 10 Oct 2014 at 7:37