cancel
Showing results for 
Search instead for 
Did you mean: 

SVG Performance

Former Member
0 Kudos

Using the Gantt Diagram project available on SDN as a template, I created a transaction that produces a PNG Gantt chart that shows scheduled process orders.

Differences between my solution and SDN:

-Each row shows all Process Orders for a Resource across the specified period.

-Each Order has the Batch and Material information inside the rectangle, no text for start and stop times

-Misc other stuff like, the orders change color when they are running.

Anyway, with 16 production lines, it is possible that the graphic can be made up of 50+ order images during a given week.

Currently for testing, I'm using three resources with about 15 orders, and the transaction takes about 12 seconds to execute. Looking at the Trace information, each image renderer and subsequent image combiner are taking the majority of the execution time (.32 and .48 seconds respectively as shown below).

[DEBUG]: 00002.18800 Begin Action ImagePeriod : ()

[DEBUG]: 00002.50000 End Action ImagePeriod : ()

[DEBUG]: 00002.50000 Begin Sequence Sequence_28 : ()

[DEBUG]: 00002.50000 Begin Action AddPeriodToEncodedImage : ()

[DEBUG]: 00002.98500 End Action AddPeriodToEncodedImage : ()

This particulary image it not very complex, the width is updated at runtime (the image is typically about 200 wide.


<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" height="600" width="1325">
        <rect height="596" id="rectDay" style="stroke:#808080;stroke-width:1;fill:#f6f6f6" width="1325" x="0" y="0"/>
        <rect height="50" id="rectDayHeader" style="stroke:#808080;stroke-width:1;fill:#C0C0C0" width="1325" x="0" y="0"/>
        <text id="date" style="font-size:22px;text-anchor:middle;font-family:Arial;font-weight:bold" x="500" y="23">Di, 24.10.2006</text>
        <text id="time" style="font-size:18px;text-anchor:middle;font-family:Arial;font-weight:bold" x="500" y="45">08:00 - 17:00</text>
</svg>

I can live with this performance, I would just like to know if there are any tricks to optimize this a bit.

Thanks,

Rod

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You could try using the Dynamic Transaction Call Action or posting to the Runner to get some parallel processing going.

Former Member
0 Kudos

Christian,

Thanks for the suggestion. That would certainly reduce the execution duration. Was curious if there was a way to optimize the image processing, it currently seems excessive.

Rod

Former Member
0 Kudos

Rod/Christian:

You can reduce this time by a HUGE percentage by dynamically building up the SVG (SVG is nothing but an XML file) and then rendering it to an image once, rather than multiple image renderings and combines, which are computationally expensive.

You'd be using the various "link" types (append, replace, etc.) to achieve this. It's actually quite straightforward, and smoking fast.

Rick

Former Member
0 Kudos

Ahh yes, that is the answer I was looking for. Of course I'll need to do some re-tooling of my transaction, but it will be worth it. In production the current transcation takes over 2 minutes to produce 10 gantt charts every hour. Thanks Rick.

Rod

Answers (0)