-
-
Notifications
You must be signed in to change notification settings - Fork 622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: (Very) slow same_window
check in mouse input event
#1886
Comments
@belrus65 Can you send me your latest lua script as a comment attachment (might need to add I was debugging mouse events a lot in Openbox past few weeks and they seemed fine, so it might be a weird interaction with cairo. I also have a few questions:
|
lua-scripts.zip Here are the files. I have a pure openbox gentoo system with 3 monitors running several conky panels on each monitor (I've included a screenshot of my desktop to make it easier to explain). The problem starts as soon as I load up to 4 lua scripts (clock & memory bar on center monitor, and cpu usage dials on the other monitors). If I move the mouse or interact with the desktop (bring up menu with key bindings) the conky processes seem to stall for some time (the more I move the mouse to longer the stall exists). None of these problems existed in the previous (1.19.8) |
Can I see your conkyrc files as well please? (For invesitgation, and I like your layout :) ) You are running multiple instances of conky, right? Like through seperate conkyrc files? |
Do you need all my conkyrc, or only the ones running the lua scripts? |
All of them :) |
@belrus65 Right, as a workaround, you can try building conky with |
ok @lineage-of-roots, i'll package it altogether as soon as I get back home. |
@belrus65 Thanks in advance |
Related to #1852. |
Here is my entire conky @lineage-of-roots. @Caellian, I'm in the middle of a deployment for a client, I will try to build conky with BUILD_XINPUT and/or BUILD_MOUSE_EVENTS disabled over the weekend. |
That's fine, try it out when you have time. Thanks for sharing the files, it will be helpful for debugging. |
Thanks for the files. Much appreciated. I ran them, they don't stall for me though. I would, however, also say just to build conky without Xinput. For a deeper dive/explanation... I would say this also has something to do with your Kernel config/build (Same for Xorg and openbox build/config) I am guessing your Gentoo Kernel is personally customized. Conky with Xinput enabled does serveral kinds of queries to Xorg (For every pixel your mouse moves. Some of it is also related to mouse polling rates) Since you have many separate instances of conky running at the same time, This is where your builds and configs come in for the Kernel, Xorg, Openbox etc etc. I just see a large jump in cpu usage, but no stalls or hang ups. Quickest solution is to build conky without Xinput. |
Thanks @lineage-of-roots, I will disable all unneeded flags this weekend and rebuild. |
Strange though, did that much of the code change from previous version? Never had any issues with lag before, and nothing changed on my system in ways of xorg or openbox (newer kernel, but it's the gentoo binary). In any case, it still will be good to streamline the conky package to my minimal requirements. Thanks again for the feedback. |
@belrus65 You're welcome Yes, the code has changed. And it can tend to behave differently across different Kernels/Distros. Previously when I was testing Conky, So the only conclusion was that different builds/configs are dealing with Xinput differently. (This is ofcourse if Conky is built with Xinput support enabled) |
Just want to point out a few things though:
It would be nice if you could run conky (built with Assuming it's up to kernel setup I'm marking this as wontfix, but send the callgrind file and I'll see whether I can improve performance on your system (or possibly for others) somehow so you don't have to rebuild your kernel or disable default functionality in order to use newer versions 😵💫 . |
@lineage-of-roots, I created a custom local ebuild repository for conky, and set -DBUILD_XINPUT=no & -DBUILD_MOUSE_EVENTS=no in the ebuild file, and re-emerged the 1.20.2 package on my system. All is working fine now, no more lag. conky --version Compiled in features: System config file: /etc/conky/conky.conf General:
Lua bindings:
X11:
Default values:
|
@Caellian, I am not sure how to modify the ebuild file to include your suggestion: "It would be nice if you could run conky (built with -DCMAKE_BUILD_TYPE=RelWithDebInfo) with valgrind when you have time (valgrind --tool=callgrind --dump-instr=yes --simulate-cache=yes --collect-jumps=yes conky) and send the callgrind.out file as that would tell us what part of code is causing this slowdown." |
Build without ebuild/portage, it's 2/3 commands but here's a step-by-step guide in the terminal:
|
Glad it worked out. I shall cherish your conky configs. Thanks again :) |
I just noticed you left your api key for the weather in your files. Just wanted to inform you of that. I won't be using it. But your files are visible here. |
@lineage-of-roots, thanks for the heads up! Was in the process of working on a deployment for a client & hurried to upload files for you and didn't pay much attention. I deleted the package for now...will replace them later tonight after I had time to review them. |
@belrus65 No need to review and replace them. Given that lineage-of-roots wasn't able to recreate the bug with your scripts, they're not that useful for debugging the issue. |
@Caellian, here is the valgrind result |
Sorry to bother, you did everything right, but you stopped conky a bit too soon. It didn't get to the main event loop yet. Leave it on a minute or two longer. Thank you for doing this btw. |
@Caellian I reran valgrind but this time a selected a conkyrc that calls a lua script and I keep getting (llua_do_call: function execution failed: attempt to call nil value) line after line printed in the terminal. I cannot Ctrl-C, stuck in endless loop, need to reboot to stop process. |
You can run |
@belrus65 There's still a little issue with the Current solution I have been doing is to manually copy Other than that, I doubt running only one instance of conky through valgrind will make the problem re-appear Your usual conky setup is, for the sake of humor, doing a DDOS attack on your Xserver lol If you really want to get to the bottom of it, then you would probably have to do the following
Closest relevant info I found is on the LibX11 github page, that says
Perhaps this is not as fixed as reported. Or it all might come down to some "Scheduling" choices by the Kernel in different builds/configs/distros The problem might also present itself in something like this chart |
Propagation is still happening without the flags, in the same way. Conky doesn't propagate events that it doesn't catch. His desktop doesn't freeze, conky does, so I think this isn't a good analogy.
There's no XInput requests. We tell XInput we want to listen for cursor movement, XInput constructs event once and sends a copy to each client (and conky) that's listening for it when they poll events. Conky doesn't propagate events that aren't over its window, so this shouldn't affect performance when cursor isn't over conky.
|
Here is the valgrind output. I had to manually copy the libcairo.so & libcairo_xlib.so to /usr/local/lib/conky folder (which I needed to create manually also). Hope this helps you, as for myself, the lag is gone since I disabled XINPUT & MOUSE_EVENTS in my custom build script. |
I did mean that in the humorous sense. And not related to any event propagation. You can see Xorg jump up in cpu usage when you move the mouse around anywhere, on any window. To simulate the effect, I launched many xeyes. A similar jump in Xorg's cpu usage can be observed then.
I shouldn't have said "requests". That sounds like an actual request I meant all the Xinput related code running. My hypothesis was/is that something is going wrong with conky (Similar to fluxbox menu delay) because of all the separate but simultaneous Xquerypointers running. From my previous testing on Debian, I knew the problem doesn't necessarily manifest across different Distros, Kernels etc etc. |
same_window
check in mouse input event
@sushi2503 Can you share which WM you're using, and whether you're running multiple conky instances or just one. I'll probably disable |
Causes performance issues for a lot of people. See #1886.
@ Caellian : I use Compiz and five conky instances but quiet simple ones and two of them are "static" (not refreshed every x seconds). |
Only the first paragraph was intended for you. I was just adding to the issue in second one. The feature will be disabled by default in the next minor update until I figure out how I can do things better. |
* Disable Xinput by default Causes performance issues for a lot of people. See #1886.
Merged into Without |
What happened?
Originally posted by @belrus65 in #1867 (comment)
Version
1.20.2
OS
Gentoo
Config
The text was updated successfully, but these errors were encountered: