VB6 vs VB2005 Performance

R

Roger

Hello all
I've been developing Visio solutions since 1994 starting with VB3 and Visio
3 through to VB6 with Visio 2003. I'm now about to start a major new project
and so have decided to use VB2005.

One aspect which will be critical to the success of this new project is the
time required to extract data from Visio files containing many thousands of
shapes. I've therefore done some simple timing tests on various
configurations, including stand-alone programs and programs using the Visio
drawing control. Obviously the drawing control, being an in-process solution,
is much faster with both VB6 and VB2005.

However, it seems VB2005 is generally much slower than VB6, especially when
using the Visio drawing control. For example, the time required to iterate
through shapes in a Visio file to extract the data1 field and names of
connected shapes is around 10 times slower in VB2005 than VB6.

Has anyone any thoughts or comments?
Many thanks
Roger
 
A

Al Edlund

My 'measurements' show about a six to one degradation when moving from vb6
to vb.net for just about everything.
al
 
M

Mark Nelson [MS]

While I'm sure there are general bottlenecks related to working with managed
code on top of an unmanaged application, there are two specific performance
issues with managed code and Visio. First, gradients in shapes
significantly impact performance in managed code solutions. The workaround
here is to avoid gradient fills. Second, the delayed cleanup of objects in
managed code through garbage collection means that Visio has a lot of "dead"
objects (API objects not drawing objects) to hang onto. There are some
scalability problems when Visio has to manage large numbers of objects.
There is not much that you can do about this second issue.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 
M

Mark Nelson [MS]

My information is a little out of date here. The gradient problem has been
corrected in the latest Service Pack of Visio 2003.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 
R

Roger

Hi Mark
Many thanks for the information; you've started me wondering about garbage
collection. I'm only in the early stages of learning about .net but I've
already accumulated a pile of books! The "Microsoft .NET Development for
Microsoft Office" book has a section on releasing COM objects and suggests
using GC.Collect(), GC.WaitForPendingFinalizers() twice. Is this technique,
or an alternative likely to help with the performance of the Visio Drawing
Control? If so, do you have any suggestions or guidelines on garbage
collection techniques when iterating through thousands of shapes in a Visio
file to extract data?
Best regards
Roger
 
M

Mark Nelson [MS]

Unfortunately that level of detail is beyond my knowledge. My guess is that
there is very little you can do on the managed code side to mitigate this.
We have investigated this problem and hope to have a better design in future
releases of Visio.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 
R

Roger

Hi Mark
I've been doing some more experiments and have found that using
GC.Collect(), GC.WaitForPendingFinalizers() twice can improve performance by
a factor of upto 5x when extracting data from Visio shapes using the drawing
control. However, figuring out the most effective place to use this trick
seems to be just a hit and miss procedure. Also I wonder if
System.Runtime.InteropServices.Marshal.ReleaseComObject() could help?

Is there any information on this type of Visio programming issues? Also is
there any VB2005 or C#2005 sample code available for Visio 2003 or will we
have to wait until Visio 12 is released which I guess will be later this
year?

Many thanks
Roger Billsdon
 
M

Mark Nelson [MS]

Hi Roger,

We are beginning to disclose plans and information about Visio 12 now. This
will continue up until the product release in the second half of 2006. We
will be releasing an updated version of the Visio SDK with Visio 12, but I
don't believe the contents of that have been finalized.

We have done work in the Visio 12 version to improve handling of automation
objects. This will mostly benefit managed code solutions since objects have
longer lifetimes under garbage collection.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top