Author |
Topic |
|
MrJones4u
Ketchup Master
83 Posts |
Posted - Feb 20 2008 : 06:12:43 AM
|
Hello,
I found that in one particular file in the project deleting, inserting and sometimes even editing will have delays of 20 seconds between every keystroke. I did some investigation and this is the results.
First I removed all includes; restarted IDE a few times in between and cleared the cache etc. just to make sure G?? no change. Then I noticed that at the end of the file inserting a line was as fast as normal so I started locking for the line where this changed and found it eventually:
catch(int nError)
{
TRACE("*** Catched RSN Error %d\\n", nError);
}
catch(CException* e)
{
DELETE_EXCEPTION(e); // <-----------------------
CString sEvent;
sEvent.Format("Load Failed on \\"%s\\"", sFilename);
CQueue::LogEvent(sEvent);
}
Before this line everything is painfully slow, after this line things are as normal.
Now the G?goodG? thing is; removing this line helps - Sort ofG? The problem then just moved 4 lines up to where the TRACE is.
Now I got crafty; I swapped the catch(intG? ) section with the catch(CExceptionG?) section and the problem was gone. So I thought. Eventually I found the slow spot again 1200 lines up.
Position = m_lGpi.GetHeadPosition();
while(Position) // <-------------
{
CGpi *pGpi = m_lGpi.GetNext(Position);
I remarked this line of code and sure enough the slow spot moved up another 1000 lines or so.
CoCreateGuid(&m_guidConfiguration);
m_mNamedPictures.InitHashTable(101); // <-------------
CTimeline::Start(this);
Now - here things get interesting; this line actually had a breakpoint set on it and when the breakpoint is removed the problem disappears. Now I did the litmus test and uninstalled VAX and tried it G?? no problems what so ever. Installed VAX again and after a while (after the database had been built) the problem reemerges.
Any ideas?
Cu, Michael
|
Edited by - MrJones4u on Feb 20 2008 06:13:33 AM |
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Feb 20 2008 : 08:05:39 AM
|
This is C++ code? It looks like C++
How long is the file? What is the file size? VA does slow down in very large files, my test file for this effect is 23,000 lines long. You mention moving 1000 lines up in the file, so obviously your file is not tiny. For me, in this massive file, VA does not slow down as badly as you describe.
Does this file use a lot of complex macros? Does the file contain a lot of conditional blocks? #ifdef DEBUG #endif, this sort of thing?
The fact that the problem emerges over time bothers me. This suggests it is not the file its self that is the problem.
If you run a CPU monitor what do you see? Are the delays being caused by the CPU maxing out? Or by something else? |
zen is the art of being at one with the two'ness |
|
|
MrJones4u
Ketchup Master
83 Posts |
Posted - Feb 20 2008 : 08:41:14 AM
|
OK, here we goG?
IDE: VC6 File Type: C++
"this" Files Size: 3789 Lines, 84969 Bytes Complex Macros: Nothing more fancy then MFCG??s IMPLEMENT_SERIAL and co. No #ifdefs CPU 100% during that delay
Project Size: 259929 Lines, 6409697 Bytes Project Files: 1224 Files
New Observation: Setting a breakpoint anywhere in any file in this project will now cause the same result; slow from line 1 to breakpoint fast after that G?? and only when VAX is installed.
|
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Feb 20 2008 : 09:12:00 AM
|
This is very strange. Your file is not that large. The solution is not really that large either. There is a known problem with VC6 and large solutions, although this does not normally show up until you have 4,000 or more files. This is actually a VC6 problem, and can be reproduced without VA installed, in even larger solutions.
Can you try closing the Class View, and see if this makes any difference?
If not can you please download the source code for ToDo list from this page:
http://www.codeproject.com/KB/applications/todolist2.aspx
I have just downloaded version 5.4.6 and opened it here. This way we can make sure we are running the same tests on the same solution. I have placed the source code onto my C: drive, so a local drive, and opened the workspace:
ToDoList\\ToDoList_All.dsw
VA's Open File dialog is reporting 465 files in total. The file "ToDoCtrl.cpp" is 10,479 lines long. I have tried adding a break point to this file and typing at the bottom of the file, and I am not seeing any problems at all. |
zen is the art of being at one with the two'ness |
|
|
MrJones4u
Ketchup Master
83 Posts |
Posted - Feb 20 2008 : 10:04:25 AM
|
Just as a reminder: The problem is visible when inserting or deleting lines *above* the "slow point". |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Feb 20 2008 : 12:19:40 PM
|
A good point. Normally errors show up below the problem point, not before it.
I have just tried adding 6 break points in 6 different functions near the top of thie file "ToDoCtrl.cpp" and typing above each of them in turn, and I am not seeing any problems here, using VC6 and VA 1626. |
zen is the art of being at one with the two'ness |
|
|
danielgodson
New Member
7 Posts |
Posted - Apr 02 2008 : 01:21:10 AM
|
I too have experienced a very similar problem but without establishing a pattern or attributing it specifically to VAX or VC6. |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Apr 02 2008 : 3:39:11 PM
|
Which version of VA are you using? Is your source code on a local drive, or on some form of network drive? How large is the file where you are seeing this?
Can you try disabling any anti-virus software you are running, to see if that makes any difference? Interactions between VA and anti-virus software are very rare, but they are known. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|