Performance suggestions

G

geejay

I have a Visio AddIn written in C#, using VSTO.

I want to know what operations I can target to improve the performance of my
app. At the moment it takes about 7 seconds to layout a page with 100 shapes
or so, all layed out automatically. There is obviously some algorithms there
to layout the shapes (like flow layouting, grouping etc).

Any ideas?

Cheers
 
P

Paul Herber

I have a Visio AddIn written in C#, using VSTO.

I want to know what operations I can target to improve the performance of my
app. At the moment it takes about 7 seconds to layout a page with 100 shapes
or so, all layed out automatically. There is obviously some algorithms there
to layout the shapes (like flow layouting, grouping etc).

That performance doesn't sound unreasonable.
 
A

AlEdlund

I'm doing about three times as many in the same time. You might consider
these

Preload stencils, shapes, and masters (datagraphics) ahead of
time.

Always test the document stencil for a shape before loading a
file, the Com+ boundary may
be slow but physical I/O is really slow.

If you're doing a data application, use datatables for data
manipulation and then
store data into the document with datarecordsets if needed (want
to auto update?).
Datatables and LINQ are significantly faster than trying to work
with datarecordsets.

' the performance coding hits
' set at beginning and reset at end
pVisApp.InhibitSelectChange = True
' set at beginning and reset at end
pVisApp.DeferRecalc = True
' showchanges and screenupdating were probably the most
important
' set at beginning and reset at end
pVisApp.ShowChanges = False
' set at beginning and reset at end
pVisApp.ScreenUpdating = False
' set at beginnning
pVisApp.OnDataChangeDelay = -2

al
 
Top