-
-
Notifications
You must be signed in to change notification settings - Fork 592
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
urxvt very slow after d7cff56cad779ee30769ec6b1a78ebb0c23281b8 #2
Comments
@CyberShadow I do suspect that change can add overhead, but didn't expect it to be this bad. I will look into it. |
@CyberShadow BTW, what is your compton configuration? I can't seem to directly reproduce the problem on my side. |
Hmm, I use a shader for transparency, but I did not think it was important. I will try to reduce the configuration to a minimal one in which the problem manifests. |
Hi, I can reproduce the problem with the default (no arguments) configuration for Compton and urxvt. If it helps, here's what urxvt's stack trace looks like while it's repainting:
Let me know if I can do anything to help diagnose this. |
@CyberShadow By default, do you mean you have an empty I tried |
Yes, I just tested again with an empty I don't know if it matters, but I use i3 (i3-gaps). Did you test with |
@CyberShadow yes, I tested mc. I wonder if enabling vsync would help, is vsync previously enabled? |
Sorry, I don't know. I'm using completely default video/X11 configuration (I don't have an Xorg.conf). |
Sorry, if you mean the Compton setting, I just tried all 6 listed in the configuration and saw the same result. |
@CyberShadow I tried to make urxvt transparent and blur the background, but I still can't reproduce this. I will leave this open in case someone has something to add. If you want to sink some time into debugging this, that will be much appreciated. I will provide support if you want. |
Okay, I know a little bit about X11 programming so I could have a look. Could you tell me a bit more for why d7cff56 is needed? And, is there a test case for it? Maybe I can find a way to fix it that doesn't result in slowness on my machine. |
@CyberShadow Basically, compton uses the damage event to determine when to update the screen. To detect damage of a window (or rather, a drawable), you create a damage attached to the drawable. There are several event report mechanism. Before d7cff56, the one used is "NonEmpty", which generates event when damaged region goes from empty to non empty. After getting this event, compton will clear the damaged region (so more event can be generated), and repaint the screen. The problem is, X server sometimes just doesn't send the damage event to the compton. The event seems to be generated, but is kept on the server and not sent, causing the whole screen to freeze. So d7cff56 change the reporting mechanism to "Raw", cause all damages to generate events. In theory, this change will increase the traffic between compton and X server, but it shouldn't increase the number of repaints. Since compton always tries to process as many events as possible before repainting. And even if compton is doing more repaints than necessary, you shouldn't see your urxvt window freeze during the repaints. |
@CyberShadow the freeze is a hard to reproduce problem, but several people have encountered this problem, see chjj/compton#494 |
I will have a look. In the worst case, we can add an option. But, if it is a problem in the X server, it should be fixed there... |
Indeed. But X is a much larger and scarier project to get into... I have made inquiries on xorg mailing list. I have yet to receive a reply. |
Thanks for the explanation. With it, and after reading the code and Damage protocol spec, I think I understand the situation. Here is what I found so far:
I think I had the freeze in chjj/compton#494 happen to me too. Too bad I didn't pay attention to it or how to reproduce it, because now I can't... |
I tried removing those calls, but didn't get any error regarding DamageSubtract
Interesting how sending packets to the client needs to involve the GPU driver...
I guess it probably has to be .. |
@CyberShadow BTW, urxvt is somewhat an outlier nowadays. most program does their rendering and won't generate so many damage reports. |
Should I make a PR to add the option? We could even go as far as make it a per-window rule ( |
@CyberShadow I'm looking for an alternative work around. It's not that nice to ask the user to choose between screen freeze and laggy windows. |
Thanks, let me know if you find something. |
@CyberShadow Can you test this branch: https://github.com/yshui/compton/tree/lotta-damage ? Probably won't work, but worth a try. |
That is MUCH better (I can no longer see Also, as I keep switching desktops in i3, it seems to randomly bug out and windows become invisible. |
@CyberShadow Have you tried using the options |
Still slow with |
I investigated the original problem a bit more, and I thinking I am getting close to the real cause. |
@CyberShadow Can you try the (This branch also has some extra changes that might contain bug). |
Wow, nice work finding the root of the problem and porting to XCB! If I suspected the problem was in the communication between the X server and Compton I could have lent a hand. As expected, the |
@CyberShadow Beware that that branch could crash quite often. Which looks like an interoperability bug between xcb and xlib. |
No problem. No crashes so far. I'll run it in gdb and get some stack traces if I run into any. |
Closing as this is fixed both in |
Squashed all the stuff: init Update README.md options performance Animation no longer jumps if started in the middle of an animation Doubled default transition length Minor bugfix, preformance Track x and y separately to aviod jumping in mid-animation repositioning Added video to readme docs docs fixed graphical glitch with non-transparent windows now animates window scaling too (but only if the window grows) added options for size transitions and actually respect the new options.. and actually respect the new options.. added center-spawn option added center-spawn-screen option fixed center spawn added no-scale-down goofed remember old windows remember old windows docs fixed shadow fixed shadow fixed shadow fixed shadow lost no-scale-down due to revert lost spawn-center due to revert Fixed yshui#2 fix missing window borders
…shui#2 using just a type and comparing the 2nd index)
…shui#2 using just a type and comparing the 2nd index)
Hi,
The commit d7cff56 seems to have introduced a regression: urxvt font drawing becomes very slow. More specifically, urxvt with the font 7x13 and window size of about 1920x2160 takes about 300-500ms to draw its contents with
mc
running in it.Platform
Arch Linux (x64)
GPU, drivers, and screen setup
RX Vega 64, AMDGPU drivers (Linux 4.18.7)
The text was updated successfully, but these errors were encountered: