Needs hints to speed up the VB IDE for a large project

Posted on 2003-11-13
Last Modified: 2010-05-01
Hi, I have a large project  (500 files, 6 MB of code lines, 50 dll/ocx references, the EXE is 15 MB) and the IDE is very slow.

It can become stalled using 100% CPU for one or two minutes.

I think it's not just about the size of the code because it was not so long one month ago with just a couple of new files since.

This happens at the initial load when i click page down on a code window.
And again when I modify a procedure argument and go to another module and click page down, so I guess he's checking again the syntax of the whole project.
Even with no option to check the syntax or display the dropdown automatically.

I traced the filesystem access and VB6.EXE is not accessing any file when this happens.

What I've tried so far with no success:

- unloading all addins
- checking and unchecking any option I could find in the vb options form
- testing another project with no form/control/ocx
- moving all enums and types in a single class/module (I thought it could reduce dependencies if this slow down the syntax checks)
- defragmenting the drive
- removing unused code

Using VB6 SP5 on W2000, NTFS, plenty of ram available, same problem on 2 different machines

I'm especially looking for hints from people who had a similar problem and found a way to improve the ide speed (something else than splitting the code into several projects !)
Question by:alain_tesio
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2

Expert Comment

ID: 9745353
I'd try the following:

1.  Clear out the TEMP folder.  Not just the system temp folder but also the user temp folder (i.e. C:\Documents and Settings\[UserName]\Local Settings\Temp and C:\Documents and Settings\[UserName]\Local Settings\Temporary Internet Files

2.  Move some classes to separate DLLs and simply reference them.  With 500 files you should be able to break up your project into a ton of separate DLLs.

3.  Uncheck unused references.  Uncheck references that are dependecies of dependencies - your main project does not need it.

4.  If all else fails, rebuild the project from scratch by adding one module at a time.

5.  There maybe an NTFS permission mess.  This means that the underlying OS code has to take extra time for each file to determine permissions.  Make sure you don't have domain users on the permission list for your files.  Actually having a domain user with access to a single file  can slow it down on a sluggish network.

Good luck!

Expert Comment

ID: 9750620
Just a question - why are you against splitting the programme into separate projects. This would usually be what people do. robdogg has suggested this too (point 2)

The reason I'm asking is that I'm rather hoping that your reason for not taking the 'standard' approach could be something that we can solve.

Another question is  - how clean is your registry. Every time you break compatibility you leave loads of old COM entries in the registry. Most serious coding shops use utilities to clean all that up between builds. Having lots of old registry keys will slow you down pretty much more than anything else.

Another approach to solving this is to start with a clean install of your operating system, install your development environment etc and then make an image of the disk. Every so often, check all your code in, restore the image and "get latest" of your sources. That's a lot of hard work, but it will have the desired effect. Still - investing in some registry cleanup tools is probably less painful.

Author Comment

ID: 9762827
Thanks for the replies, I've tried emptying the temp folders and checking NTFS permissions, and I'll look at the registry.

About splitting the project into several DLLs it would certainly help but I'd prefer not to (this is not a problem at all except the IDE efficiency, it's harder to debug code, and I think it would be slower with calls between several dlls than having all classes in the same process, right ?)

I hoped for some less obvious "magic hints" about a known VB weakness like parsing conditional defines or a large number of fragmented files or more than 256 enums or something similar !
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Accepted Solution

robdogg10 earned 500 total points
ID: 9767240
>>>About splitting the project into several DLLs it would certainly help but I'd prefer not to (this is not a problem at all except the IDE efficiency, it's harder to debug code, and I think it would be slower with calls between several dlls than having all classes in the same process, right ?)<<<

In one word, NO.  Once objects are in memory there is no difference in speed because everything at that point is just a memory jump.  You may get a bit of a difference (probably nothing that's perceptible to human eye) because the OS has to load more than one DLL.  

As far as debugging code, you normally debug a set of functionality.  If you have logically separated your app into logical sets of functionality (i.e. DLLs), then when debugging you will at most have 2 or 3 DLL projects loaded into the IDE.

As someone else here mentioned, you might want to clean out the registry.  There are several tools that can do that.  

One is Registry Mechanic

Registry Magic<ype=dl_elite_dlnow&lop=link&edId=3&siteId=4&oId=3120-2094-10234738&ontId=2094&destUrl=%2F3001-2094-10234738.html

And bunch of others.  This may really help.

Expert Comment

ID: 9802314
It probably helps to know that you can debug straight from one instance of VB to another. I often work with three instances at once in order to debug a multi-tier application from top to bottom

Author Comment

ID: 9832876
Thanks for your replies, no hint (emptying the temporary folders, cleaning the registry, ntfs permissions ...) helped so I'll give points based on what I learned here, that you can load a dll and an exe in the ide

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question