Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Cursor lag
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kimbo
Senior Member

33 Posts

Posted - Oct 19 2021 :  08:50:28 AM  Show Profile  Reply with Quote
Hello,

I run into a strange input lag when navigating the cursor through some parts of my code. It took up to half a second to handle a simple cursor down input.

A WPA trace brought up lots of calls to GetFileAttributes from VAX in worker threads and also from the DispatchMessage in the main thread.

Then I monitored the file access from VS for one cursor down event and I got 7k (!) calls to GetFileAttributes (target was the directory where the header file of the code function was defined).

Any ideas what's going on there? Cause it's annoying as hell that VAX can increase the editor input lag so much.

W10, VS2017, VAX 10.9.2420.0

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Oct 19 2021 :  10:39:37 AM  Show Profile  Reply with Quote
No immediate good ideas, but some questions to try and get some clues.

Is this a file specific problem, or are you seeing this problem in all files?

How many files do you have in your solution?

If you open VA's Open File in Solution dialog (Alt-Shift-O) the title bar contains two numbers. The first number is the number of files currently listed, which changes as you filter the list. The second number is the total number of files in the list, which is normally the number of files in your solution. What is this second number? I am trying to get a sense of the size of your solution here, in case this is a general performance related problem.

Are you using a monitor with a high refresh rate? I recall a couple of odd effects being reported with these monitors.

Do you have VA's navigation bar showing? By default it is showing and is at the top of the editor window, and is where the Alt-M list is shown. Does turning this Off have any effect on this problem?

VA Options -> Display -> Display VA Navigation Bar:

VA updates the navigation bar as you move through the code, so its a possible factor.

If you place the caret at the first column, so it is mostly sitting in white space, does this have any effect on this? I am trying to work out if the caret moving from one symbol to another symbol could be a factor.

zen is the art of being at one with the two'ness
Go to Top of Page

kimbo
Senior Member

33 Posts

Posted - Oct 19 2021 :  11:26:13 AM  Show Profile  Reply with Quote
Hi,

it appears only in one part of a cpp file I'm working on (there are some simple function implementations). The declerations are in some files in a folder called "generated_sources" (~50 files). This folder exists for every build target I have in the project (debug,release,master,qa) and the files are part of the vcxproj.

AltShiftO reports ~8k files. VAX navigation bar display has no influcence, but the delay looks like it is connected to the navigation bar update in some way. The caret position has no influnce.

It's not a constant delay when navigating through the lines, but when I press RETURN and then CursorUp I always get a delay (and only in this file in the specific part).

But I'm wondering why there are thousands of folder checks (to get the change time?). I have a Ryzon 9 with 16/32 C/T and VAX has 16 threads to do stuff.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Oct 20 2021 :  06:49:34 AM  Show Profile  Reply with Quote
The fact that this problem only happens in one part of one file is interesting, and suggests that there is something going on here that is confusing our parser. Sometimes very heavy macro or template code can do this. Without knowing why our parser is confused I don't have any good ideas about all of the folder checks, but if I had to guess, I would assume VA is trying to look up some symbols that are confusing it.

Can you please try making a new, default C++ console solution and then copy just this single "problem" file into the test solution, and see if you still get the same problem when opening this file? I know that in isolation the file won't make much sense, but I am trying to find out if the problem is due to the file its self, or something to do with the file when it is inside your normal solution.

zen is the art of being at one with the two'ness
Go to Top of Page

kimbo
Senior Member

33 Posts

Posted - Oct 20 2021 :  07:49:22 AM  Show Profile  Reply with Quote
It's not so easy to seperate the code, cause it's a huge project. But maybe I can give you some more hints:

I deleted the whole solution and recreated it and now it's a little bit faster. As I said, we generate code interfaces in the "generated_sources" folder, which look like this:

namespace programs
{
    namespace program1
    {
        struct Data { ... };
        struct Interface { ... };

        void update( Context* );
    }

    namespace program2
    {
        struct Data { ... };
        struct Interface { ... };

        void update( Context* );
    }

    ...
}

There are round about 50 files which contain over 300 programs (with namespace, types and update function).

Now I'm in a cpp where I implement the update function of one of those programs. I put some of those structs on the stack and write some code. When I move the cursor inside the program (in row or column direction) I get 600-3000 calls to GetFileAttributes on the generated_sources folder for every caret position change.

Not sure if this leads to the edit lag but I saw lots of those calls from VAX from the main thread as well.

My current speedup is due to the fact that I only have one generated_sources folder left instead of eight.

Edited by - kimbo on Oct 20 2021 07:52:59 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Oct 20 2021 :  08:36:18 AM  Show Profile  Reply with Quote
What do you have:

VA Options -> Projects and Files -> Upon opening a file, parse all other unparsed files in the same directory:
if Solution is empty
if Solution is not empty

set to?

I am starting to wonder if VA is seeing file system activity in the background, and if this is part of the problem here.

Is it the file, or the directory the file lives in that matters here?

zen is the art of being at one with the two'ness
Go to Top of Page

kimbo
Senior Member

33 Posts

Posted - Oct 20 2021 :  09:08:31 AM  Show Profile  Reply with Quote
[x] if Solution is empty
[ ] if Solution is not empty

But there is no difference when both are checked. And all files are parsed when opening the project (and all files inside the generated_sources folder are part of the project).

The folder is only created/updated when I build the project. And I monitored the whole system and nobody else is doing anything there.

The cpp file with the function implementation where the lag occours is somewhere else.

When I navigate through other parts of the code I only see some GetFileAttributes calls to specific files and never directories. So I don't know what the difference is here.
Go to Top of Page

kimbo
Senior Member

33 Posts

Posted - Oct 20 2021 :  09:28:14 AM  Show Profile  Reply with Quote
If you are interested in the callstack - not really helpful without debug symbols ;)

VAX thread:

KernelBase.dll!GetFileAttributesW
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
ntdll.dll!RtlpTpWorkCallback
ntdll.dll!TppWorkerThread
kernel32.dll!BaseThreadInitThunk
ntdll.dll!__RtlUserThreadStart
ntdll.dll!_RtlUserThreadStart


devenv main thread:

KernelBase.dll!GetFileAttributesW
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VA_X.dll!<Missing ImageId event>
VAX.interop.dll!WholeTomatoSoftware.VisualAssist.Interop.VaManagedService::GetCommentFromPos 0x0
VaMefAsync.dll!dh::a 0x0
VaMefAsync.dll!dh::AugmentQuickInfoSession 0x0
Microsoft.VisualStudio.Platform.VSEditor.dll!Microsoft.VisualStudio.Language.Intellisense.Implementation.LegacyQuickInfoSource::AugmentQuickInfoSession 0x0
Microsoft.VisualStudio.Platform.VSEditor.dll!Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession+<TryComputeContentFromLegacySourceAsync>d__46::MoveNext 0x0
mscorlib.ni.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
mscorlib.ni.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib.ni.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib.ni.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.JoinableTaskFactory+SingleExecuteProtector::TryExecute 0x0
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.JoinableTaskFactory+SingleExecuteProtector+<>c::<.cctor>b__20_0 0x0
WindowsBase.ni.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
WindowsBase.ni.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl()
WindowsBase.ni.dll!System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
mscorlib.ni.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib.ni.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib.ni.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
WindowsBase.ni.dll!MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
WindowsBase.ni.dll!System.Windows.Threading.DispatcherOperation.Invoke()
WindowsBase.ni.dll!System.Windows.Threading.Dispatcher.ProcessQueue()
WindowsBase.ni.dll!System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
WindowsBase.ni.dll!MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
WindowsBase.ni.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
WindowsBase.ni.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
WindowsBase.ni.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
WindowsBase.ni.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
WindowsBase.ni.dll!MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
?!?
user32.dll!_InternalCallWinProc
user32.dll!UserCallWinProcCheckWow
user32.dll!DispatchMessageWorker
user32.dll!DispatchMessageW
VA_X.dll!<Missing ImageId event>
?!?
msenv.dll!CMsoCMHandler::EnvironmentMsgLoop
msenv.dll!CMsoCMHandler::FPushMessageLoop
msenv.dll!SCM::FPushMessageLoop
msenv.dll!SCM_MsoCompMgr::FPushMessageLoop
msenv.dll!CMsoComponent::PushMsgLoop
msenv.dll!VStudioMainLogged
msenv.dll!_VStudioMain
devenv.exe!util_CallVsMain
devenv.exe!CDevEnvAppId::Run
devenv.exe!WinMain
devenv.exe!__scrt_common_main_seh
kernel32.dll!BaseThreadInitThunk
ntdll.dll!__RtlUserThreadStart
ntdll.dll!_RtlUserThreadStart

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Oct 20 2021 :  10:56:18 AM  Show Profile  Reply with Quote
Does this odd file have any #include statements that don't include a file extension? For example:

#include <vector>

but probably rather more unusual names. I am trying to think of any reason that directories would be being checked, especially since this problem is file specific.

Can you please try disabling the IDE intellisense parser, via:

IDE tools menu -> Options -> Text Editor -> C/C++ -> Advanced -> IntelliSense -> Disable IntelliSense = True

I suspect this won't have any effect on this at all, but just want to rule it out.

Can you please look at VA Outline and the Alt-M list, and see if they seem correct? Are you seeing any obvious signs that they are confused or wrong? Since the problem is file specific I am still wondering what there is in the file that might be a trigger.

zen is the art of being at one with the two'ness
Go to Top of Page

kimbo
Senior Member

33 Posts

Posted - Oct 20 2021 :  11:13:02 AM  Show Profile  Reply with Quote
All includes have basename + extension. The path "generated_sources" is never used in any includes.
IntelliSense is always off cause it's even slower than VAX ;)
Nothing special in Alt-M.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Oct 21 2021 :  08:49:31 AM  Show Profile  Reply with Quote
If you close and reload the problem file, does this fix the problem?

Just looking over this, you mention seeing the problem after editing some of this code, so I am wondering if editing the code is required to trigger this problem, as opposed to simply opening the file.

zen is the art of being at one with the two'ness
Go to Top of Page

kimbo
Senior Member

33 Posts

Posted - Oct 21 2021 :  09:27:23 AM  Show Profile  Reply with Quote
No, when I close and reopen it, I get 3k directory queries when I click into a line of the update function.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Oct 21 2021 :  10:56:07 AM  Show Profile  Reply with Quote
Assuming you have a few minutes, can you please try the following simple test.

Make a new, default C++ console solution, placed anywhere, and then add this existing file, in its current location, to this solution. If you then open this file again, inside the test solution, do you still get all of these directory queries?

It seems that the files location matters, so I am trying to separate out the files location in your filesystem from any project settings, to see if we can get an idea of what is going on here.

zen is the art of being at one with the two'ness
Go to Top of Page

kimbo
Senior Member

33 Posts

Posted - Oct 21 2021 :  11:26:32 AM  Show Profile  Reply with Quote
No, I don't get any of those queries in this solution.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Oct 22 2021 :  08:44:36 AM  Show Profile  Reply with Quote
Thank you for testing that. This seems to rule out the file on its own, as well as the location of the file as the trigger.

Can you try copying the directory lists from the two settings:

*** general include directories
Project properties -> C/C++ -> General -> Additional Include Directories

*** get added to VA stable include directories list
Project properties -> VC++ Directories -> Include Directories

in your main project across to the test project and see if this now triggers the bug? Please reload the test solution after adding the settings, just to make sure that VA has had ample chance to pick them up.

zen is the art of being at one with the two'ness
Go to Top of Page

kimbo
Senior Member

33 Posts

Posted - Oct 25 2021 :  05:55:02 AM  Show Profile  Reply with Quote
Yes, this triggers queries to the generated_sources folders (which is part of the additional include dirs).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Oct 25 2021 :  06:16:43 AM  Show Profile  Reply with Quote
Can you please check that adding only the generated_sources folder to the additional include directories is enough to trigger this problem? It seems likely that this is all you need to do, but I don't want to just assume this is the case.

If this is all that is required, do you get the same problem if you copy the full "generated_sources" folder into the test solution, moving the additional include directories setting so it points at this local copy of "generated_sources"?

I am trying to put together a small, isolated test solution that shows the problem, so we can completely detach it from your main solution.

Assuming this can be done, would it be possible to get a copy of this simple test solution, purely for testing purposes? I realise this is often not possible, but it's worth asking on the off chance that it can be done. If it is possible please send me the files via email:

support@wholetomato.com

including this thread ID or URL in the description, so we can match it up.

zen is the art of being at one with the two'ness
Go to Top of Page

kimbo
Senior Member

33 Posts

Posted - Oct 25 2021 :  08:42:51 AM  Show Profile  Reply with Quote
At first I saw the queries with the generated_sources folder but after a VAX Rebuild/Clear they were gone.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Oct 26 2021 :  07:45:49 AM  Show Profile  Reply with Quote
Ouch.

Does rebuilding the VA symbol database have any effect on this problem in your full solution?

This is starting to sounds like some form of VA symbol database problem, which suggests there is something going on in your main solution that VA does not understand properly. Unfortunately that isn't much of a clue on its own.

zen is the art of being at one with the two'ness
Go to Top of Page

kimbo
Senior Member

33 Posts

Posted - Oct 27 2021 :  04:43:32 AM  Show Profile  Reply with Quote
No I did rebuild the database several times
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17503 Posts

Posted - Oct 27 2021 :  07:37:05 AM  Show Profile  Reply with Quote
Lets try VA logging, and see if this tells us anything helpful about this problem. This page explains turning on logging, and locating the log files that are created.

https://docs.wholetomato.com/default.asp?W305

To try and get a good sense of what is happening here, can you please load the IDE, but not load your solution. Then turn on VA logging:

VA Options -> Performance -> Enable logging

load your solution, in case something interesting is logged here, then load the problem file and trigger the problem. After reproducing the problem, and seeing the lag, can you please close the IDE. This stops the log files from getting any larger, and helps to keep them focussed on just what might show the problem.

Please send me the files via email:

support@wholetomato.com

including this thread ID or URL in the description, so we can match it up.

Are you aware of any general problems with VA not picking up symbols in your code? Not colouring symbols correctly? Jumping to the wrong place when you use Alt-G? I am wondering if there are any general problems showing up that might give us a clue as to what is going on and why VA is confused.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2021 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000