Slowness / High CPU Usage when typing in Categories and Tags Topic is solved

Moderator: abstr

fitnerd
Posts: 53
Joined: Wed Nov 20, 2019 7:19 am

Slowness / High CPU Usage when typing in Categories and Tags

Post by fitnerd » Sun Jan 05, 2020 12:30 pm

Hi Dan!

Using TDL 7.2.21 on Win 10 x64.

There is a very noticeable slowdown / unresponsiveness and high CPU usage whenever I type in category name or tag in the appropriate fields instead of using drop-downs to check desired items with the mouse. The later works fine without any slowdowns.

It happens even with tiny tdls - containing a few tens of tasks and as little as15 tags / categories.

The expected behavior is that a tag / category is set quickly regardless whether it was typed in (and Enter was pressed), or dropdown was used and it was selected with a mouse.

Similar issue happens with other even custom attributes.

It also happens regardless of whether the typed-in item exists in the dropdown already or is a new one. I mean I can imagine it would be a bit slower for a new one, but not for existing one.

A somewhat related issue is with handling comas to enter more than one item at a time. Sometimes such items are interpreted as a single new item, instead of checking several existing items.

Thank you.

User avatar
abstr
Site Admin
Posts: 370
Joined: Sun Jul 28, 2019 12:22 pm

Re: Slowness / High CPU Usage when typing in Categories and Tags

Post by abstr » Sun Jan 05, 2020 11:26 pm

1. Can you reproduce it with 'Introduction.tdl' on a clean install?
2. For how long has this been happening?

fitnerd
Posts: 53
Joined: Wed Nov 20, 2019 7:19 am

Re: Slowness / High CPU Usage when typing in Categories and Tags

Post by fitnerd » Mon Jan 06, 2020 1:07 pm

1. Yes, there is a noticeable delay there as well. Around 1 second (as opposed to around 5 seconds for my task lists) - probably due to the fact that it only has 4 categories and no tags.
2. It's been like this for as long as I can remember. It is only now I decided to write about this. Certainly older versions had this issue too.

User avatar
abstr
Site Admin
Posts: 370
Joined: Sun Jul 28, 2019 12:22 pm

Re: Slowness / High CPU Usage when typing in Categories and Tags

Post by abstr » Mon Jan 06, 2020 11:43 pm

Thanks.

1. Can you enable logging via the Tools menu, use the software for a few minutes, then close it and attach the log file please?
2. Are the other droplists affected too: Status, Allocated To, Allocated By?
3. Does disabling your anti-virus software make any difference?
4. Does 7.3.A6 suffer from the same problem?

fitnerd
Posts: 53
Joined: Wed Nov 20, 2019 7:19 am

Re: Slowness / High CPU Usage when typing in Categories and Tags

Post by fitnerd » Sat Jan 11, 2020 6:35 pm

Thank you for looking into this. Sorry for the delay in getting back to you.

1. See the file attached. I enabled logging, added a non-existing tag by typing, UI froze for like 10 seconds, then unfroze, then saved task list and quit the program. Unfortunately the log does not seem to contain anything about adding a new tag. And the file in question was small - only 86 tasks and maybe 30 tags.
2. Yes, it seems to be the case.
3. I don;t use AV software other than Windows Defender, and disabling it does not make a difference.
4. I will get back to you on this ASAP.
Attachments
ToDoList.log.zip
(2.13 KiB) Downloaded 269 times

User avatar
abstr
Site Admin
Posts: 370
Joined: Sun Jul 28, 2019 12:22 pm

Re: Slowness / High CPU Usage when typing in Categories and Tags

Post by abstr » Mon Jan 13, 2020 12:18 am

>> added a non-existing tag by typing, UI froze for like 10 seconds

When exactly does the freeze occur? On typing the first letter or on hitting <return> to finalise it?

>> the file in question was small - only 86 tasks and maybe 30 tags

Can you send me the list of tags please?

1. Open the tasklist in a text editor
2. Scroll to the very bottom of the tasklist
3. Locate the last </TASK> closer
4. After that should be the list of '<TAG>...</TAG>'

fitnerd
Posts: 53
Joined: Wed Nov 20, 2019 7:19 am

Re: Slowness / High CPU Usage when typing in Categories and Tags

Post by fitnerd » Wed Jan 15, 2020 5:41 pm

It happens on hitting Return. And it occurs not just with Tags, but also Categories, and any other custom attributes. If I select an item or items from the dropdown, everything is ok, but if I type an item - whether it exists in the list or not, upon hitting Enter it freezes.

I confirm that it happens with TDL 7.3 A7 as well.

Sorting the list seems to have no effect (whether sorted or not). Whether all tasks are expanded or collapsed does not matter either.

Turns out I was wrong about the size of the tag list - it has 65 items not 30. Still I would imagine software should have no issues even with a few hundred items in any attribute. Below is the category list for which the slowness occurs. Hopefully it suffices, as it does not seem to matter what is in that list.

Code: Select all

<CATEGORY>ACC</CATEGORY><CATEGORY>ACT</CATEGORY><CATEGORY>APT</CATEGORY><CATEGORY>ARC</CATEGORY><CATEGORY>BAD</CATEGORY><CATEGORY>BED</CATEGORY><CATEGORY>BUS</CATEGORY><CATEGORY>BUY</CATEGORY><CATEGORY>DEV</CATEGORY><CATEGORY>EAT</CATEGORY><CATEGORY>EDU</CATEGORY><CATEGORY>ENT</CATEGORY><CATEGORY>FIN</CATEGORY><CATEGORY>FIT</CATEGORY><CATEGORY>FIX</CATEGORY><CATEGORY>FUN</CATEGORY><CATEGORY>GET</CATEGORY><CATEGORY>GYM</CATEGORY><CATEGORY>HYG</CATEGORY><CATEGORY>INF</CATEGORY><CATEGORY>MED</CATEGORY><CATEGORY>MET</CATEGORY><CATEGORY>MKT</CATEGORY><CATEGORY>ORG</CATEGORY><CATEGORY>OUT</CATEGORY><CATEGORY>PAY</CATEGORY><CATEGORY>PHY</CATEGORY><CATEGORY>PLA</CATEGORY><CATEGORY>SEC</CATEGORY><CATEGORY>SOC</CATEGORY><CATEGORY>SUP</CATEGORY><CATEGORY>TRA</CATEGORY><CATEGORY>TRY</CATEGORY><CATEGORY>XXX</CATEGORY><CATEGORY>ZZZ</CATEGORY>
I was a bit surprised as to why neither the tags not categories have their own root element within Xml, as I would imagine storing them in their unique xml element would be more efficient, like "<CATEGORIES><CATEGORY>AAA</CATEGORY></CATEGORIES>"

I did attempt to capture a stack trace while it was "not responding" after I hit Enter, this is what I captured for 7.3 A7:

Code: Select all

0, ntoskrnl.exe!KeWaitForMutexObject+0x30c1
1, ntoskrnl.exe!KiCheckForKernelApcDelivery+0x27
2, ntoskrnl.exe!ExReleasePushLockExclusiveEx+0x222
3, win32kbase.sys!Win32AllocPoolWithQuotaZInit+0x5d0
4, win32kbase.sys!GreIsRendering+0x13
5, win32kbase.sys!GetDCEx+0x7a6
6, win32kbase.sys!NtUserGetDC+0xeb
7, ntoskrnl.exe!setjmpex+0x6f53
8, wow64cpu.dll!TurboDispatchJumpAddressEnd+0x544
9, wow64cpu.dll!TurboDispatchJumpAddressEnd+0x503
10, wow64cpu.dll!BTCpuSimulate+0x9
11, wow64.dll!Wow64LdrpInitialize+0x236
12, wow64.dll!Wow64KiUserCallbackDispatcher+0x40d
13, wow64win.dll+0x2dbf
14, ntdll.dll!KiUserCallbackDispatcher+0x24
15, wow64win.dll+0xf3a4
16, wow64win.dll+0x3ea2
17, wow64win.dll+0x4149
18, wow64.dll!Wow64SystemServiceEx+0x153
19, wow64cpu.dll!TurboDispatchJumpAddressEnd+0xb
20, wow64cpu.dll!BTCpuSimulate+0x9
21, wow64.dll!Wow64LdrpInitialize+0x236
22, wow64.dll!Wow64KiUserCallbackDispatcher+0x40d
23, wow64win.dll+0x2dbf
24, ntdll.dll!KiUserCallbackDispatcher+0x24
25, wow64win.dll+0xf3a4
26, wow64win.dll+0x3ea2
27, wow64win.dll+0x4149
28, wow64.dll!Wow64SystemServiceEx+0x153
29, wow64cpu.dll!TurboDispatchJumpAddressEnd+0xb
30, wow64cpu.dll!BTCpuSimulate+0x9
31, wow64.dll!Wow64LdrpInitialize+0x236
32, wow64.dll!Wow64LdrpInitialize+0x120
33, ntdll.dll!LdrInitShimEngineDynamic+0x3047
34, ntdll.dll!memset+0x1e4c5
35, ntdll.dll!LdrInitializeThunk+0x5b
36, ntdll.dll!LdrInitializeThunk+0xe
37, win32u.dll!NtUserGetDC+0xc (No unwind info)
38, ToDoList.exe!CDialogHelper::CalcMaxTextWidth+0x40 (No unwind info)
39, user32.dll!GetWindowLongW+0x127 (No unwind info)
40, ToDoList.exe!CAutoComboBox::InsertUniqueItem+0x1f2 (No unwind info)
41, ToDoList.exe!COwnerdrawComboBoxBase::RefreshDropWidth+0x7 (No unwind info)
42, ToDoList.exe!CAutoComboBox::InsertUniqueItem+0x1f9 (No unwind info)
43, ToDoList.exe!CAutoComboBox::AddUniqueItem+0x19 (No unwind info)

User avatar
abstr
Site Admin
Posts: 370
Joined: Sun Jul 28, 2019 12:22 pm

Re: Slowness / High CPU Usage when typing in Categories and Tags

Post by abstr » Fri Jan 17, 2020 12:18 am

Curious, on my Windows 10 machine this operation takes just a fraction of a second to complete even with the extra categories.

>> I did attempt to capture a stack trace ... for 7.3 A7

That was helpful, though there is something very strange about it

38, ToDoList.exe!CDialogHelper::CalcMaxTextWidth+0x40 (No unwind info)
39, user32.dll!GetWindowLongW+0x127 (No unwind info)
40, ToDoList.exe!CAutoComboBox::InsertUniqueItem+0x1f2 (No unwind info)

41, ToDoList.exe!COwnerdrawComboBoxBase::RefreshDropWidth+0x7 (No unwind info)
42, ToDoList.exe!CAutoComboBox::InsertUniqueItem+0x1f9 (No unwind info)


The highlighted lines in no way correspond to the underlying code.

Instead, this is what I see in the debugger:

ToDoList.exe!CDialogHelper::CalcMaxTextWidth(...) Line 846
ToDoList.exe!COwnerdrawComboBoxBase::RefreshDropWidth(...) Line 224
ToDoList.exe!CAutoComboBox::InsertUniqueItem(...) Line 320
ToDoList.exe!CAutoComboBox::AddUniqueItem(...) Line 258


Could you possibly also get a stack trace for 7.2 please so we can see if the same weirdness occurs there too?

fitnerd
Posts: 53
Joined: Wed Nov 20, 2019 7:19 am

Re: Slowness / High CPU Usage when typing in Categories and Tags

Post by fitnerd » Fri Jan 17, 2020 11:24 am

Thank you for looking into this.

I do not seem to have pdb symbols for 7.2.21, so the stack traces do not have function names and would be of little use to you. Is there a way I can get a debug build for the 7.2 branch for me to test?

Here's what I got:

Code: Select all

0, ntoskrnl.exe!KeWaitForMutexObject+0x30c1
1, ntoskrnl.exe!KeWaitForMutexObject+0x1521
2, ntoskrnl.exe!KeWaitForMutexObject+0xadb
3, ntoskrnl.exe!KeWaitForMutexObject+0x1ff
4, ntoskrnl.exe!EtwEventEnabled+0x71d
5, ntoskrnl.exe!ExAcquireResourceSharedLite+0x95b
6, ntoskrnl.exe!ExEnterCriticalRegionAndAcquireResourceExclusive+0x3f
7, win32kbase.sys!EnterCrit+0x49
8, win32kfull.sys!NtUserPostMessage+0x26e6
9, win32kfull.sys!NtUserPostMessage+0x2433
10, win32kfull.sys!NtUserPostMessage+0x1efd
11, win32kfull.sys!NtUserMessageCall+0x15a4
12, win32kfull.sys!NtUserMessageCall+0x1ac
13, win32kfull.sys!NtUserMessageCall+0xf5
14, ntoskrnl.exe!setjmpex+0x6f53
15, wow64win.dll+0xf3a4
16, wow64win.dll+0x3ea2
17, wow64win.dll+0x4103
18, wow64.dll!Wow64SystemServiceEx+0x153
19, wow64cpu.dll!TurboDispatchJumpAddressEnd+0xb
20, wow64cpu.dll!BTCpuSimulate+0x9
21, wow64.dll!Wow64LdrpInitialize+0x236
22, wow64.dll!Wow64KiUserCallbackDispatcher+0x40d
23, wow64win.dll+0x2dbf
24, ntdll.dll!KiUserCallbackDispatcher+0x24
25, wow64win.dll+0xf3a4
26, wow64win.dll+0x3ea2
27, wow64win.dll+0x4103
28, wow64.dll!Wow64SystemServiceEx+0x153
29, wow64cpu.dll!TurboDispatchJumpAddressEnd+0xb
30, wow64cpu.dll!BTCpuSimulate+0x9
31, wow64.dll!Wow64LdrpInitialize+0x236
32, wow64.dll!Wow64KiUserCallbackDispatcher+0x40d
33, wow64win.dll+0x2dbf
34, ntdll.dll!KiUserCallbackDispatcher+0x24
35, wow64win.dll+0xf3a4
36, wow64win.dll+0x3ea2
37, wow64win.dll+0x4149
38, wow64.dll!Wow64SystemServiceEx+0x153
39, wow64cpu.dll!TurboDispatchJumpAddressEnd+0xb
40, wow64cpu.dll!BTCpuSimulate+0x9
41, wow64.dll!Wow64LdrpInitialize+0x236
42, wow64.dll!Wow64KiUserCallbackDispatcher+0x40d
43, wow64win.dll+0x2dbf
44, ntdll.dll!KiUserCallbackDispatcher+0x24
45, wow64win.dll+0xf3a4
46, wow64win.dll+0x3ea2
47, wow64win.dll+0x4149
48, wow64.dll!Wow64SystemServiceEx+0x153
49, wow64cpu.dll!TurboDispatchJumpAddressEnd+0xb
50, wow64cpu.dll!BTCpuSimulate+0x9
51, wow64.dll!Wow64LdrpInitialize+0x236
52, wow64.dll!Wow64KiUserCallbackDispatcher+0x40d
53, wow64win.dll+0x2dbf
54, ntdll.dll!KiUserCallbackDispatcher+0x24
55, wow64cpu.dll!TurboDispatchJumpAddressEnd+0x544
56, wow64cpu.dll!TurboDispatchJumpAddressEnd+0x503
57, wow64cpu.dll!BTCpuSimulate+0x9
58, wow64.dll!Wow64LdrpInitialize+0x236
59, wow64.dll!Wow64LdrpInitialize+0x120
60, ntdll.dll!LdrInitShimEngineDynamic+0x3047
61, ntdll.dll!memset+0x1e4c5
62, ntdll.dll!LdrInitializeThunk+0x5b
63, ntdll.dll!LdrInitializeThunk+0xe
64, win32u.dll!NtUserMessageCall+0xc (No unwind info)
65, user32.dll!SendMessageW+0x57a (No unwind info)
66, user32.dll!SendMessageW+0x137 (No unwind info)
67, comctl32.dll!TaskDialogIndirect+0x1fef9 (No unwind info)
68, user32.dll!AddClipboardFormatListener+0x49b (No unwind info)
69, user32.dll!DispatchMessageW+0x97a (No unwind info)
70, user32.dll!CallWindowProcW+0x8d (No unwind info)
71, mfc42u.dll!Ordinal2377+0x61 (No unwind info)
72, mfc42u.dll!Ordinal6370+0x5b (No unwind info)
73, mfc42u.dll!Ordinal1108+0xbc (No unwind info)
74, mfc42u.dll!Ordinal1571+0x36 (No unwind info)
75, mfc42u.dll!Ordinal1572+0x2f (No unwind info)
76, user32.dll!AddClipboardFormatListener+0x49b (No unwind info)
77, user32.dll!DispatchMessageW+0x97a (No unwind info)
78, user32.dll!DispatchMessageW+0x51a (No unwind info)
79, user32.dll!SystemParametersInfoW+0x4a9 (No unwind info)
80, ntdll.dll!KiUserCallbackDispatcher+0x4d (No unwind info)
81, user32.dll!SendMessageW+0x57a (No unwind info)
82, user32.dll!SendMessageW+0x137 (No unwind info)
83, ToDoList.exe+0x13b680 (No unwind info)
84, ToDoList.exe+0x13be7d (No unwind info)
85, ToDoList.exe+0x1387e0 (No unwind info)
86, ToDoList.exe+0x1382c6 (No unwind info)
87, ToDoList.exe+0x663db (No unwind info)
88, ToDoList.exe+0x66259 (No unwind info)
89, ToDoList.exe+0xe2974 (No unwind info)
90, ToDoList.exe+0xdaa16 (No unwind info)
91, mfc42u.dll!Ordinal5157+0x7b6 (No unwind info)
92, mfc42u.dll!Ordinal6370+0x3a (No unwind info)
93, mfc42u.dll!Ordinal1108+0xbc (No unwind info)
94, mfc42u.dll!Ordinal1571+0x36 (No unwind info)
95, mfc42u.dll!Ordinal1572+0x2f (No unwind info)
96, user32.dll!AddClipboardFormatListener+0x49b (No unwind info)
97, user32.dll!DispatchMessageW+0x97a (No unwind info)
98, user32.dll!CallWindowProcW+0x8d (No unwind info)
99, ToDoList.exe+0x14f2a9 (No unwind info)
100, ToDoList.exe+0x14f2e2 (No unwind info)
101, ToDoList.exe+0x1582b2 (No unwind info)
102, ToDoList.exe+0x14f288 (No unwind info)
103, ToDoList.exe+0x14f2e2 (No unwind info)
104, ToDoList.exe+0x1218e8 (No unwind info)

User avatar
abstr
Site Admin
Posts: 370
Joined: Sun Jul 28, 2019 12:22 pm

Re: Slowness / High CPU Usage when typing in Categories and Tags

Post by abstr » Sat Jan 18, 2020 12:27 am

Thanks fitnerd.

Here's a build of 7.2.22 with symbols.

ps. Can you also please attach your preferences file?

Locked