-
Notifications
You must be signed in to change notification settings - Fork 538
High CPU usage while typing #830
Comments
Spellcheck enabled? |
Spell checking is disabled. Turning it on and off doesn't make a difference. |
Does Task Manager report HC using more CPU time during that? Regarding the GTK version, we know what version it is since we build it ourselves (it's 2.24.19) |
If you mean while switching the spell checker, then there is a small peak, but a very brief one. Turning the spell checker on adds about 0.05 s to CPU user time, turning off about adds ~0.08 s. One more thing I found: Holding down any of the modifier keys (shift, ctrl, alt) causes HC to fully occupy one of the CPU cores. Pressing down another modifier key does nothing (the CPU usage is still high), but when that key is released, the CPU load drops. If however the first key is released (while the second one is still being pressed), there's only a short drop of CPU load, and it backs up to full load once again. |
I meant when releasing a key, since that is when you said your CPU activity peeks in the OP.
Is the rest of your post starting from this line with spellcheck enabled? I cannot repro any of it without spellcheck. If so, can you see if you still repro with spellcheck disabled? |
It happens with and without spell checking. |
@shogoonn the only performance issue I have ever seen is when spell check is used on massive words (100s of chars). That is the only reason I brought it up and is unrelated. |
I didn't say that. |
I too have this problem. Spell check being enabled or not does not seem to remove the bug. |
I've just got a new HexChat version (2.10.0 x64) and the issue is still there. @CKtalon What hardware are you running HC on? |
Intel i5 [email protected] |
Maybe it is a race condition then, one that shows up only on some recent faster CPU's. |
Happens when you hold down CTRL, ALT or SHIFT. |
Visual Studio profiling using 8f9ed6d version. I was holding the CTRL key in the highlighted part and writing the alphabet before that Platform is Windows 8.1 Update 1 x64 on Intel i5 @ 3.70 GHz 4 threads , you can notice how it uses over 20% CPU so almost a whole core. Please remove the "unconfirmed" label to the issue. |
@jackpoz Since you know what you're doing, get the PDBs for the GTK bundle (ask tomek in #hexchat) and give us the callstack too. |
You should definitely be able to get a list of callers going back all the way to hexchat code. That is what I meant by call stack. Also https://mail.gnome.org/archives/libsoup-list/2009-December/msg00010.html and misc google results for |
here's the callstack going back from that poll_rest():
|
can we at least get this issue "confirmed" instead of leaving it with "unconfirmed" label ? |
this issue is now 1 year old, is there any plan about how to tackle it ? |
Issue still happens using HexChat 2.10.2 x64 on Windows 8.1 |
Just a heads up, I'm not noticing any issue on Win7, Hexchat 2.9.5 32bits. Might be interesting to bisect |
Cannot confirm either, Win7 Hexchat 2.10.1. Seems like an issue exclusive to one or more versions of Windows 8.x |
I can confirm that this issue is happening on my computer also. My CPU usage did indeed jump up quite a bit from typing like how it was described by the OP. Typically CPU usage was about 10-15% when typing quickly and only happened when keys got released. Holding a key down did not increase CPU usage. Windows 8.1 |
Upgraded to Win 8.1 x64, hexchat 2.10.2, successfully reproduced. |
Reproduced on win10 x64 using hechat 2.10.2 |
|
Reproduced on Hexchat 2.10.2 x64 on windows 10. (the hexchat about box says "Windows 8") |
@genbtc Read the comment directly before yours, especially the third point. |
41% CPU usage pressing CTRL on "Nick name" using "HexChat 2.10.2 x86.exe" on WIndows 10 x64 with Intel i5 @ 3.70 GHz 4 threads Is there any hexchat developer who uses Windows x64 ? Quite disappointed that no developer tested it in 1 month after @Arnavion asked to try the 32 bits version |
It's unfortunate that the 32-bit version has the same issue.
Yes, but I use W7 which does not demonstrate this issue (as mentioned before in this thread). @tomek You're on 8.1? |
X86 version totally does it too: http://puu.sh/k5jGU/a7eac9d48f.png But my computer has all the "tablet" shit explicitly disabled on purpose, and this did not fix it. |
Windows 8 added spell checking and HexChat < 2.11.0 never made use of it. |
I forgot to add... You should wait like 5 minutes to really tell the difference after you disable it, I've also noticed if you disable Cortana along with the Runtime broker it is even better. but then Cortana kicks back in along with the Runtime broker in less then a minute, So for now i just keep the runtime broker disabled |
@Mo0NTan What version do you use? I already said "Windows 8 added spell checking and HexChat < 2.11.0 never made use of it.". Also does disabling it in Preferences > Input do nothing compared to this? |
@Mo0NTan Dude dont mess with runtimebroker...You disable it from PC Settings->Devices->Typing, and I checked on my system, closing runtimebroker did not help anything since I already had these off,, and I would never use Cortana .... : |
oh, Thanks,That seems to work too, i did manage a hack to disable cortana, but that didn't significantly help at all, Seems the spellcheck does a bit. It goes to like 10 to 15% apposed to 30% and don't get stuck at 30. It could be video card driver related. I don't know? |
The CPU usage issue affects only HexChat and not other applications like Notepad++, trying random things like killing Windows processes doesn't look much useful. |
I wonder if an older version of hexchat regardless of the security holes wouldn't have this issue. I just realized how hot this is on my legs while on my laptop, |
This issue is now 2 years old. In the meantime a new OS version came out (Windows 10) and still has the same issue. |
Can one of us unofficially modify GTK and provide a diff patch so that we can share it amongst ourselves in the meantime ? I would gladly recompile it as a second person to test. Unless someone starts the ball rolling, and at least proves that modifying GTK can fix the issue and that theres no other way to fix hexchat's code itself, then I doubt the GTK people will admit theres a problem on their end and just push the blame back saying its hexchat's fault... |
@genbtc We already ship a few patches that never made it upstream, so if somebody solves this that would be acceptable. |
You probably didn't restart VS to make it pick up the new value after you edited it.
You're building HC using GTK+openssl built by us. To make changes to GTK you will need to build GTK. |
Did any developer update to Windows 10 in the meantime ? |
Tested HexChat 2.12.0 on Windows 10 x64, still same issue. I saw some Windows 8 features in the changelog, am I to believe finally someone upgraded to Windows 8+ and can now work on this issue ? |
Looking at the data I gathered 596 days ago #830 (comment) it could be that MsgWaitForMultipleObjectsEx() is called with a timeout too small. https://blogs.msdn.microsoft.com/oldnewthing/20151113-00/?p=92111 also suggests another possible case where MsgWaitForMultipleObjectsEx() returns with an error that is handled by calling again the same function over and over and over. Would any hexchat developer feel like working together to fix this issue by checking the 3 possible causes mentioned above ( or will they just stare at the issue ) ? Edit: continuing with blaming poor gpoll() implementation, https://lists.gnu.org/archive/html/qemu-devel/2014-05/msg01425.html and https://lists.gnu.org/archive/html/qemu-devel/2014-05/msg03572.html provide a patch to fix a "significant performance degradation of QEMU" |
Instead of waiting on us (which for gtk-win32 issues is basically just me), you can compile gtk-win32 yourself and test any patches you want. |
HexChat build system is a nightmare, with custom Visual Studio build steps that don't support special characters or spaces and cryptic build errors. The repo layout HexChat chose scares away any developer who would attempt to build it (tried and gave up 3 times so far). https://github.com/hexchat/gtk-win32/blob/master/README.md doesn't provide any way to get a .sln with HexChat and all the dependencies so one can just F5 and debug into the application and all related dependencies. I profiled the issue, found a patch, opened a ticket to GTK+ https://bugzilla.gnome.org/show_bug.cgi?id=764415 and all you could write was "build it yourself". Going back to my question
the answer is clearly "No" |
Hello, I noticed this bug while searching on the internet. I experienced the same issue and I think I've found the problem. See here: https://bugzilla.gnome.org/show_bug.cgi?id=771568 The patch is to GDK. |
Thanks for the heads up @jtanx and for the patch. |
@jackpoz Looks like they didn't backport that patch to Gtk2, I left a message so it will get into the next release. |
Please do
|
Any update on this ? |
These patches have been commited to gtk-2-24 upstream. So next time HexChat gets a release on a new enough gtk version it will be fixed. |
HexChat 2.9.6.1 (build date: 2013-09-15, both x86 and x64 non-portable builds, clean install of x64 build and then x86 to see if it makes a difference).
OS: Windows 8.1 64-bit
The CPU is quad core i5-4570. When idle, the CPU runs at ~800MHz. Fast typing in a message box causes the frequency to rise up to ~3 GHz, and the CPU usage in this state is up to 20% (total of all cores). One of the cores is being loaded up to 80% (with some core switching). Slower typing causes less CPU load (on average). The power consumption rises from ~28W to more than 40W (I have a watt meter plugged in).
Sometimes the CPU load stays that high after I had finished typing, and drops back to normal only after I switch to another window.
No suspicious activity found with Sysinternals Process Monitor (disk writes, sockets, registry, etc.). No visible changes in memory usage while typing.
The CPU load is caused by a key release event. When I hold down a key, the CPU usage stays low until I release it. Releasing a key adds about 0.5 seconds to the "CPU user time" performance counter of the process.
I think it may have something to do with GTK+'s crappy keyboard handling. There's no information on the GTK+ version in Help->About window.
The text was updated successfully, but these errors were encountered: