Test Insight 1.2.0.1 seems to be consuming CPU cycles in the IDE

Issue #161 resolved
David Hoyle created an issue

I do not know if you have seen this behaviour but I’ve been battling with the above issue since what I perceived to be updating Test Insight to include RAD Studio 11.x (see below).

If you do not have a project open, everything seems fine but as soon as I open a project (I’m using 10.4.2) the IDE will not idle consuming circa 8-9% on a 6 core machine with hyper-threading. It kills my laptop battery and makes the IDE sluggish.

I’ve looked at whether the same behaviour is seen in 11.1. The answer is yes but not as serious.

I’ve just tried 1.2.0.0 (the previous version I have) and I get the same. If I disable the expert from the IDE the IDE idles at circa 3-4%.

One of the most noticeable effects is pressing the down key in the editor to move through a file. With Test Insight installed the cursor moves by 15-20 lines then freezes and then starts again.

I’ve tried resetting the register for Test Insight but that has not made a difference and a clean reg for BDS (-rClean) also did not fix the issue (Test Insight on its own with no other IDE plugins).

If you are not seeing this or cannot reproduce this, I might have to do a full reg clean for 10.4.2 to see if that helps (I’ve had to do this once before for another issue which I cannot remember). Test Insight didn’t behave like this in the past so I still think it might be something to do with my machine setup.

Comments (9)

  1. Stefan Glienke repo owner

    I have not seen this - please make sure the source is indeed TestInsight by checking the call stack of the busy thread (via ProcessExplorer for example).

  2. David Hoyle reporter

    Stefan,

    I’ve tried to get a thread call stack but as usual, it doesn’t tell me anything useful…

    ntoskrnl.exe!KiSwapContext+0x76
    ntoskrnl.exe!KiSwapThread+0x500
    ntoskrnl.exe!KiCommitThreadWait+0x14f
    ntoskrnl.exe!KeWaitForSingleObject+0x233
    ntoskrnl.exe!KiSchedulerApc+0x3bd
    ntoskrnl.exe!KiDeliverApc+0x2e9
    ntoskrnl.exe!KiCheckForKernelApcDelivery+0x2b
    ntoskrnl.exe!ExReleaseResourceAndLeaveCriticalRegion+0xc2
    win32kbase.sys!W32CalloutDispatch+0x382
    win32k.sys!W32CalloutDispatchThunk+0x31
    ntoskrnl.exe!ExCallCallBack+0x3d
    ntoskrnl.exe!NtFindAtom+0x58
    ntoskrnl.exe!KiSystemServiceCopyEnd+0x25
    wow64cpu.dll!CpupSyscallStub+0xc
    wow64cpu.dll!Thunk0Arg+0x5
    wow64cpu.dll!BTCpuSimulate+0x9
    wow64.dll!RunCpuSimulation+0xd
    wow64.dll!Wow64LdrpInitialize+0x12d
    ntdll.dll!LdrpInitializeProcess+0x1932
    ntdll.dll!_LdrpInitialize+0x15f
    ntdll.dll!LdrpInitialize+0x3b
    ntdll.dll!LdrInitializeThunk+0xe
    0x0000000000000000
    

    I will now rebuild my reg/IDE settings and see what I get.

  3. David Hoyle reporter

    A clean registry didn’t work. A clean IDE with no other experts or packages including a clean desktop file still used a high percentage of CPU cycles with TI install and ~0 without.

    The only thing I’ve got left is an uninstall/reinstall of 10.4.2 which will have to wait for another day.

  4. David Hoyle reporter

    After a complete uninstall and reinstall of 10.4.2, a fresh IDE with TestInsight and my main project open does not consume CPU cycles. I just now need to rebuild the setup.

    Stefan, thank you for your patience, you can close this issue.

    regards

    Dave.

  5. David Hoyle reporter

    This issue returned quite rapidly after I thought I had fixed it. It’s taken a while for me to get around to investigating (removing all plug-ins and 3rd party packages doesn’t affect the issue) however I have narrowed the issue down to whether a project in the IDE is marked as a TestInsight project. If I uncheck this option the CPU returns to a low value.

    This suggests that TestInsight is doing some processing all the time (on a timer?) when that option is enabled. Are you able to tell me what it is doing so I can investigate why it is taking so long on my machine when everyone else doesn’t seem to see this issue?

    regards

    Dave.

  6. Stefan Glienke repo owner

    TestInsight is not doing any processing all the time - the timers being used are:

    • for the “Run test continuously when idle” which checks every 100ms if the user was idle for a given amount of time (configurable via the environment options under Third Party->TestInsight) - if the icon is not checked (the clock with the circular arrow - left of the floppy icon) the timer is not enabled

    • for the “Run tests when the project is saved” option (the floppy icon) which is only enabled after a save to give a slight delay before kicking off the background compilation and run of the tests

    • for the animated icon during tests executions - again this is only enabled during execution of a test project
    • for the status text to update the time since last test run - triggered every second

    I can only see that CPU consumption is slightly higher when the TestInsight Explorer window is open and docked. I would assume that due to the kinda aggressive and suboptimal theming code something in that window (probably the VST?) is executing more code than it should.

  7. David Hoyle reporter

    Stefan, I’ve still not gotten to the bottom of this even trying to debug the IDE with the IDE. Is it possible to provide a MAP file for 1.2.0.1. I’m wondering if that might provide some context information I can use either in the IDE or in SamplingProfiler.

    All I’ve been able to see so far are, calls from TestInsight down into OpenProcess().

  8. Log in to comment