Why performance slow?

Hi,

I am evaluating Aspose Diagram for use in our organization - so doing some performance testing.

I tried creating a .vsdx file with 100 pages, each having 101 shapes (simple rectangle shapes).
Initially the process was fast and created 5 pages in about 1 minute.
But, it became so slow with time that in 30 minutes, it had created only 65 pages.
The performance continued to degrade further.

Please let me know why this happens,
and how to improve the performance- any flag/property to set?
Or any other approach?

Hi,


Thank you for contacting support. We created a new VSDX drawing with 100 pages, each having 101 shapes. Aspose.Diagram for Java version 17.4.1 takes 33977 milliseconds in our working environment. We have attached an output VSDX to this reply and also refer to the download of latest version 17.4.1: Download Aspose.Diagram for Java 17.4.1

Kindly share the complete details of your test case, including input files (if any), code, JDK version, IDE and operating system. It will help us to replicate the performance issue in our working environment. Your response is awaited.

Hi,

Correction: The above statistics were for 100 pages with 101 shapes and 100 connectors.
However, even for 100 pages with just 101 shapes and no connectors, it takes 14 minutes 36 seconds.

Attachments-
- AddConnectShapes.vss
- MultiplePagesPerf.java

Other details:
JDK version: jdk 1.6
IDE: Eclipse Juno Service Release 2
OS: Windows 8.1

PS: No attached output vsdx file from your side. Please resend.

Thanks.
After some more exploration-

I commented the below-
diagram.addMaster(visioStencil, connectorMaster);
from my java class (MultiplePagesPerf.java) which resulted in some improvement in performance.

However, there are 2 things-

1. After removing the addMaster() method call, there was no effect on the diagram rendering.
- What is the purpose of this method?
- Why was there no effect compared to the diagram which had this call?

2. The performance was good initially- drawing 50 pages with 101 shapes and 100 connectors each in just 13 seconds.
But it started degrading after that, became very slow and finally crashed with Out Of Memory- Java Heap Space error on 79th page.
Any performance tips?
Any improvement in the code that I attached with the earlier comment?

Thanks.



Hi,


Thank you for the details. Each Visio shape belongs to a master, you can say a shape instance is the extended form of its master. When you loaded a stencil file by calling the constructor of a Diagram class, then you do not need to call AddMaster method anywhere in the code. You need to add a master only one time and do not repeat AddMaster call for a same master.

We recommend our clients create the small Visio drawings, remove unused masters, reduce the number of group shapes, split a multi-page drawing into the separate drawings, remove unused themes, data graphics and styles. It is because Aspose.Diagram API loads each drawing into the main memory and then performs manipulation tasks.

Based on your use case, when we removed the call of addMaster method, Aspose.Diagram API takes 67 seconds to generate an output VSDM. You can adjust the Java heap size in your environment based on the sizes of Visio drawings. It will help you to get the best performance.

asthac:
PS: No attached output vsdx file from your side. Please resend.
We have attached an output VSDM (here).

Hi @imran.rafique,

We are doing performance testing again with our application.

As mentioned above we are using:
JDK version: jdk 1.6
IDE: Eclipse Juno Service Release 2
OS: Windows 8.1
Aspose: 17.8.0

We are generating the VSDX drawing with 107 pages. Drawing report is as:
DrawingReport.PNG (7.2 KB)

If we are using max VM heap size 1024m. Drawing is generated 3 times easily. But when we go for 4th time. Performance degrades. 5tm time it takes too long to generate drawing.
With max heap size 2048m. We are able to generate same file 6 times easily and after that performance degrades.

We have analyzed our application with Visual VM and created heap dump. Here is the screenshots of Heap dump and Visual GC.

VisualGc.PNG (25.0 KB)
HeapDump.PNG (61.6 KB)

Most of instances present are of UnitFormulaErr, DoubleValue and BoolValue classes and they are consuming maximum memory. Visual GC also shows that Old gen space is completely fill and objects are not getting garbage collected.
Note: We are creating different Diagram each time.

We are having large cases and we want better performance . Performance is very good when we generate drawing first time. But it degrades as we generate it multiple time. Is there any solution to this problem?

Thanks,
Astha

@asthac,
We need your code snippets to replicate the performance issue in our environment. We tried to prepare a code example as per your description, but the performance is not downgrading gradually. Your response is awaited.

Best Regards,
Imran Rafique

@imran.rafique

We have again analyzed our application code and found that problem was residing in our application logic. We are sorry for inconvenience caused to your team.

Thanks,
Astha

@asthac,
It is nice to hear from you that the problem has been resolved. Please feel free to let us know when you require any assistance.