Excessive CPU usage while running VB.NET devenv.exe seems to be to probelm.
Posted on 2005-05-13
I am converting a VB6 app to Visual Studio 2003. I have one small section of code that takes over 30 seconds to exeute. The following is the code:
Do Until rsGRShort.EOF
iCount = 0
sExitAvailable = "NO"
Do Until iCount = lstSelect.Items.Count Or sExitAvailable = "YES"
sWorkBuild = VB.Left(VB6.GetItemString(lstSelect, iCount), 45)
iByteCount = InStr(1, sWorkBuild, " ")
sWorkBuild = VB.Left(sWorkBuild, iByteCount - 1)
If sWorkBuild = rsGRShort.Fields("DEVICE_NAME").Value Then sExitAvailable = "YES"
iCount = iCount + 1
If sExitAvailable = "NO" Then
sGPCDeviceName = rsGRShort.Fields("DEVICE_NAME").Value
There are only 83 rows in the record set and 83 entries in the list box. When this routine runs devenv.exe is using over 80% of my CPU (Pent 4 - 3.2) or 30 seconds. This seems excessive to me. Does anyone have any ideas.