Visio Development Top Five Performance Tips

Started by Visisthebest, June 29, 2020, 01:44:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

These 5 performance tips for programming Visio with .NET I understand how the first 4 work but not the 5th:

https://surrogate-tm.github.io/mailant/2004/09/22/dev-luv-visio-development-top-five-performance-tips.htm

"5. Drop all shapes first to any random location: It is faster to drop all your shapes in a random location on a page and then reposition them as needed."

I don't understand how this is faster than dropping them in the correct position right away.
Visio 2021 Professional

Paul Herber

One drop of n shapes followed by setting the X and Y locations of those n shapes is quicker than doing n drops. For 5 shape drops you might not be bothered but for hundreds ...

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Visisthebest

Wow really surprising I would have guessed dropping then setting the correct shape positions to be a lot slower. Wondering why this is, may give some insight in to how the Visio engine works internally.

I guess setting ShowChanges to False:
https://docs.microsoft.com/en-us/office/vba/api/visio.application.showchanges

While dropping hundreds of shapes can also help speed things up.
Visio 2021 Professional