News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Shape limitations Maximum

Started by jerry_csa, August 23, 2019, 12:58:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jerry_csa



Is there a maximum number?

Using interop:
I am dropping shapes into diagram and as number goes up the amount of time between the drops continually increases.

is there a way to avoid this .. more layers .. not selecting shapes as they drop ...


Paul Herber

There are no limits, it just gets slower. This is normal, nothing can be done about it but it does take hundreds/thousands of shapes for it to really make a difference.
I wrote a short article about it some time ago:
http://www.paulherber.co.uk/articles/visio-articles/visio-slowdown/

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

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

Visisthebest

Paul thank you for testing this, but isn't the SheetID 2-byte integer size limiting the amount of shapes on a page?

Methods like these:
https://docs.microsoft.com/nl-nl/office/vba/api/visio.page.getformulas

Specify a 2-byte integer for the sheet ID, so I guess that about 32.000 or 64.000(?) shapes/subshapes on a page is the maximum. What do you think?

I wonder if Visio 2019 will be much faster on an AMD 4800U 8-core CPU with 16GB running really large diagrams, these superfast laptops are well below $1000 now.
Visio 2021 Professional

Paul Herber

I think other limitations are likely to come into operation before the 2-byte int range is exceeded.
Electronic and Electrical engineering, business and software stencils for Visio -

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

Nikolay

#4
Quote from: Visisthebest on September 19, 2020, 08:29:16 AM
I wonder if Visio 2019 will be much faster on an AMD 4800U 8-core CPU with 16GB running really large diagrams, these superfast laptops are well below $1000 now.

Just wondering if the number of cores matters? Isn't Visio recalculation engine single-threaded (so it can use only one core)?

Visisthebest

Nikolay if this is so then there is still great room for performance improvement in the Visio rendering engine!

I know Excel takes advantage of multiple cores especially in calculation-intensive spreadsheets.
Visio 2021 Professional

Visisthebest

Paul do you know if the 2-byte range for the Shape ID is a hard limit? I am asking because this would allow for a VBA Array lookup table of a dimension of no more than 65536 items seriously speeding up some algorithms we use, in particular making performance more linear and predictable in 3000+ (sub)shape diagrams.
Visio 2021 Professional

Nikolay

#7
Shape ID is 32 bit ("long", in VBA terms)

The limitation of 2-byte array applies only to the SetFormulas/GetFormulas functions, probably for historical reasons.
Anyways, Visio will sure be dead long before you actually try to put 64.000 shapes on a diagram, so I would not worry about that much.

A huge number of details while keeping number of shapes/recalculations low is usually achieved by using vector-style-images (wmf, emf, svg) as shapes.
This is done by most equipment stencil providers, like CISCO, HP, etc.   
This approach allows you to have basic operations like move/resize (as a group), while not consuming costly computational resources for formulas.
Basically, usually you don't really need "smartness" for every single detail shape (except for basic move/resize), you need "smartness" only at the "top" level.

Paul Herber

It's not a number that can be contained within 2 bytes. I've just created a diagram containing one of my computer chip packages shapes, a QFP-144, which is a grouped shape containing 290 sub-shapes. I duplicated this shape repeatedly until the shape IDs went up over 65535, in fact I got to nearly 70000. As the diagram is only 1 master shape the saved file isn't too large, just under 1MB.
P.S. this was 237 shapes.
Electronic and Electrical engineering, business and software stencils for Visio -

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

Visisthebest

Nikolay thank you that is a good idea to use WMF/EMG/SVG pictures for more complicated shapes (visually) that only have simple behavior, I wonder if a diagram with hundreds of shapes with gradients will become faster in Visio for instance (on older laptops, diagrams with several hundreds of shapes with gradients can become quite slow in my experience).

Paul thank you for doing this test! I think I'll go through the page's shapes collection first to find the highest ID before making the lookup Array because obviously a max 65536-size array might have edge cases like your shapes with ID's over 70.000!

Looks like the SetFormulas/GetFormulas and DropMany methods have some edge cases as well!

If you use DropMany:
https://docs.microsoft.com/en-us/office/vba/api/visio.page.dropmany

but there are 65536 shapes on the diagram, then the Array returned (of shapes dropped) with have some pretty interesting integer-size IDs. Good to build in some checking of the highest shape ID number on the page before doing a DropMany.
Visio 2021 Professional

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 319 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1192KB.
Tokens: post-login.
Cache hits: 13: 0.00157s for 26,721 bytes (show)
Cache misses: 3: (show)
Queries used: 17.

[Show Queries]