Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: Heads-up: KDEers: Particularly kde3-ers,
Date: Wed, 26 Aug 2009 20:32:40
Message-Id: pan.2009.08.26.14.27.08@cox.net
In Reply to: Re: [gentoo-amd64] Re: Heads-up: KDEers: Particularly kde3-ers, by Volker Armin Hemmann
1 Volker Armin Hemmann posted on Tue, 25 Aug 2009 01:33:23 +0200 as
2 excerpted:
3
4 > n Montag 24 August 2009, Sebastian Beßler wrote:
5 >> szalkai@×××××××.net schrieb:
6 >> > Duncan please give some examples of major breakage in KDE4?
7 >>
8 >> I'm not Duncan but I have 5 reasons not to switch to kde4 atm.
9 >>
10 >> 1) Speed: I have a AMD Athlon(tm) 64 X2 Dual Core Processor 4400+ with
11 >> 8GB of ram and a Radeon HD 3600 card but still kde 4.3 most of the time
12 >> feels like walking through mud.
13 >
14 > turn of composite or install a xorg-server with the
15 > fedora_dont_backfill_bg_none.patch and see kde fly.
16
17 In general, agreed, but there's more too it than that. Here, while I did
18 need to make config changes, it wasn't near as drastic as turning off
19 composite or even just window translucency, tho in testing that did work,
20 and I didn't have to go patching my xorg either, tho that may well be the
21 most effective for frglx users, the ones with the biggest problems
22 dealing with that patch.
23
24 The performance problem as I experienced it was a multi-headed hydra.
25 Fixing one issue helped but there were others too. Only after dealing
26 with (or bypassing, as just shutting off composite does) them all did I
27 have a kde4 desktop anything close to as responsive as my kde3 desktop
28 had been.
29
30 Two of the issues had been dealt with by the time I started my real push
31 to get kde4 working here, with 4.2.4. One kde fixed, one's still a kde
32 issue but I had learned my way around it by that point.
33
34 The one kde fixed was that in early kde4 versions, it was way to easy to
35 set OpenGL rendering when it was broken on that hardware, as early kde4
36 did nothing to stop you. Not only would that result in a crash, but it
37 would often result in kde being unable to start again, because it was now
38 set to broken OpenGL. By 4.2.4 (and I think for 4.2.0, maybe even
39 4.1.something), kde had fixed that. It now tries to detect if OpenGL
40 will work before setting it, and normally won't let you set it if it
41 thinks it won't work. You can override it, but in ordered to do so you
42 have to click thru several warnings, and anybody doing that should be
43 prepared to live with the consequences. One bug down, and a very bad one
44 at that, so good work, kde.
45
46 The one I had learned around, that still exists, is that while kde now
47 detects OpenGL compatibility and won't let you switch to it without
48 warnings if it thinks it won't work, on the all-effects tab (of the
49 desktop effects settings applet), there's still no indication of what
50 effects simply do nothing in xrender/composite-only mode. One thus has
51 to trial-and-error enable and test anything that looks interesting one by
52 one, and if it does nothing, preferably disable it again. If they won't
53 work anyway in xrender/composite-only mode, they should be disabled in
54 that mode, so only the effects that actually work are available to select
55 and try. Since most don't work without OpenGL, showing them as available
56 to try and then having them do nothing when people do just that, is
57 confusing at best. Dim them out and don't let people select them in that
58 case, and usability on that tab for Composite-only users would go up
59 several hundred percent. By 4.2.4 however, when I decided to really push
60 toward a usable and well configured for my use kde4, I had already
61 learned which ones did nothing, so that didn't bother me any more, other
62 than simply knowing it continues to be an issue.
63
64 That leaves the two issues I actually had to deal with in my push.
65
66 By this time, Gentoo/kde had straightened out pretty much all of the kde3/
67 kde4 combination issues and it was possible to run a kde4 app on a kde3
68 desktop, or conversely, without the settings for the one being
69 overwritten by the other. As it was obvious I wasn't making much
70 progress trying to go whole-hog kde4, and it was now possible, I decided
71 to try running and configuring individual kde4 apps on my kde3 desktop,
72 so by the time I actually switched to a kde4 desktop, at least the
73 individual apps would mostly be already configured to my liking.
74
75 It was thus that I was able to discover these two issues separately, as
76 otherwise, the one would have masked the other, and performance was so
77 bad on kde4 that I had trouble getting anything serious at all done.
78
79 So it was that I began working thru the major kde4 apps one by one on my
80 kde3 desktop, unmerging the kde3 version so the kde4 version would be
81 invoked when I ran the app (with FEATURES=buildpkg, I could always emerge
82 -K the kde3 version and get back a working config if necessary, but it
83 turned out not to be necessary) configuring them as necessary, then going
84 on to the next one. Since kcontrol is v3 and systemsettings v4, I was
85 able to easily invoke systemsettings as necessary from kde3 as well, thus
86 able to configure all those without issue (well, without issue running it
87 on kde3, at least. There was the colors issue I already posted about,
88 and another one I might discuss later.) konsole, kmail, konqueror, all
89 the normal apps, passed without major issue.
90
91 After I got thru with the normal apps, I thought a bit about kwin, then
92 killed the kde3 version, and launched the kde4 version, direct from
93 konsole window. It worked! =:^)
94
95 Well, sort of. kwin v4 launched just fine, and the colors as configured
96 in systemsettings worked, and the kde4 kwin setting all took effect, but
97 NOW THE SYSTEM WAS SLOW! I had found the first of the what turned out to
98 be two performance issues.
99
100 In Desktop Effects, All Effects tab, second from the bottom of the
101 Appearance section, is Translucency. With it enabled (as I had it since
102 it worked just fine on kde3), click on the wrench button to configure
103 it. At the bottom of the left-hand column is Fading duration. This was
104 my problem.
105
106 On fading duration, if you hit the spinner, you'll note that each
107 increment is 100 ms. I'm not sure what the default was, but it was WAY
108 too high. While the obvious intent is that it's supposed to be the
109 duration of the entire effect, it seems here as if it configures the
110 duration for each step of the animation. What was obviously several
111 hundred ms seemed to do that for each step, with the entire effect
112 running for several seconds. Moving between one window and another just
113 once, that worked, if it was slightly slow, but with several windows on
114 the desktop and focus follows mouse (my default) set, it did NOT work, as
115 now it was several seconds per transition, five, ten, twenty seconds
116 after I stopped moving the mouse before the effects finished doing their
117 thing! WAY WAY WAAAAYYY too slow!!
118
119 The simple thing is to simply set that to instant, 0 ms. However, typing
120 a specific value in the textbox also works, and I discovered that
121 anything up to about 20ms was fine. But of course using the spinner, the
122 resolution means 0 or 100ms, unless you type it in.
123
124 A related setting that I didn't notice in 4.2.4 so I'm not sure if it's
125 there or not, but that I DID notice in 4.3.0, is back in the Desktop
126 Effects dialog, on the General tab. Animation speed, with choices of
127 instant, very fast... extremely slow. Apparently, this controls what the
128 "default" value in the fading duration setting above is. Of course, I
129 now have that set to instant. But back in 4.2.4 when I discovered the
130 problem, I'm not sure if the General tab setting was there or not, and it
131 was the fading duration setting that I was able to configure to kill that
132 problem.
133
134 That was the first of the two performance issues I ran into. The rest of
135 the kwin v4 on kde3 configuration went without issue, and I used kde3
136 with kwin v4 for several hours, no problem at all, after I fixed the
137 duration thing.
138
139 That was the last thing I could really configure from the kde3 desktop,
140 so after that, it was time to actually try kde4 again, and see if it
141 worked better now. Pretty much the only thing remaining to configure was
142 the desktop itself, replacing kdesktop and kicker with plasma, when
143 restarted X with the kde4 desktop. So that's what I did, hoping the kwin
144 duration fix now had kde4 running smoothly. BUT KDE4 WAS STILL SLOW!!
145
146 What could be the problem now? Turn off transparency just to check, sure
147 enough the problem went away. But it couldn't be /just/ that, as that's
148 a kwin v4 thing, and I had it running fine on kde3. So the problem now
149 had to be the kde4 desktop itself, or rather, how it interacted with kwin.
150
151 Sure enough, the second problem was plasma, but what and how? Well, I
152 was asking myself the same question. What was different between kicker/
153 kdesktop and plasma, that could have plasma being slow much slower?
154
155 Then I had my answer. When I had been experimenting with earlier kde4
156 versions, before the panels worked very well, I had put a number of
157 plasmoids on the desktop. Back in kde3, I routinely ran the ksysguard
158 kicker applet, monitoring cpu activity, coretemps, load, memory, etc, and
159 as kde4 had ksysguard (aka system monitor) but no ksysguard plasmoid to
160 replace the ksysguard kicker applet, I had the cpu temps and cpu activity
161 system monitor plasmoids, among others, on the desktop.
162
163 Of course, kde3's kdesktop was much more static. What thus ended up
164 being the problem was all those dynamically updating plasmoids on the
165 desktop -- triggering a bug I'll mention in a moment, but not even kde
166 devs knew about that bug at the time, and it was too technical for users
167 to groke.
168
169 But what I decided (correctly, tho I didn't realize the ultimate cause)
170 was that since the problem went away when I disabled transparency, and
171 since it had to be plasma related, and since kde3's kdesktop didn't show
172 the issue, it had to be due to all those plasmoids on the desktop -- that
173 was the biggest difference between it and kdesktop.
174
175 What I decided was happening was that with those dynamically updating
176 plasmoids on the desktop, by themselves, everything worked relatively
177 fine. But with several layers of windows over top, with those dynamic
178 updates having to work themselves up the stack thru layers of semi-
179 transparent windows, the updates to the entire stack must be killing the
180 performance. Again, I was right, but for the wrong reason, as we'll see.
181
182 Anyway, as I suspected, when I created new panels to put the widgets in
183 and moved the widgets from the desktop onto the panels, the issue
184 disappeared. I expected it would, because the panels are normally either
185 hidden, or on top. There's not the multiple layers of compositing going
186 on that I thought was the problem.
187
188 So that's what I did, I moved all the widgets off my desktop. It's the
189 bare wallpaper now, not so much as a folderview on it. And my
190 performance is back to normal! =:^)
191
192 So it took two config changes to get reasonable performance. First,
193 kwin's translucent window effects needed set to instant. Second, at
194 least for now, the plasma desktop can't have plasmoids, particularly
195 dynamically updating plasmoids, on it. Either of those wrong is a
196 performance killer, and together, they were REALLY bad. What's worse, it
197 would have been quite difficult to figure it out, had I not taken one app
198 at a time as I did, because the other issue would have always masked the
199 improvement to some degree even if I /did/ get the one right. So I was
200 very fortunate in a way, in that I did have the opportunity to run apps
201 from the one on the other (on some distributions, that's not possible,
202 and it wasn't on Gentoo for awhile either, because you ended up with
203 screwed up settings every time you tried, but the Gentoo/kde folks
204 finally got that working =:^), and in that I did have the insight to try
205 tackling the issues a single app at a time.
206
207 OK, so what's the real problem I keep mentioning? Just a couple weeks
208 ago, one of the kde hackers realized there was a qt4 bug. The plain
209 English version is this: On qt4 to-date, if a graphic element is
210 entirely removed without first deleting it from the parent graphics
211 context (think removing a widget that's no longer needed, without first
212 telling qt to delete it from the window it had been drawing it on), qt
213 triggers a redraw of the entire context (the entire window), instead of
214 just the bit where the widget was at. It shouldn't matter. If the
215 element is removed, qt should know where it was, and be smart enough to
216 repaint just that bit, regardless of whether it was actually deleted from
217 the drawing context first, or not.
218
219 A lot of kde devs had code that did the removal without the delete first,
220 and the last couple weeks they've been committing fixes. Some of these
221 will make it to 4.3.1 or 4.3.1. Others might not make it until 4.4.0
222
223 Now if it's just one single event, that's not too bad, a single redraw of
224 an entire window takes a fraction of a second, but if if that's all it
225 is, a single event, no big deal.
226
227 But guess who was one of the big users of the bad code? Right, plasma.
228 Turns out that each plasmoid update was triggering a repaint, not for
229 that relatively small rectangular area, BUT FOR THE ENTIRE CONTAINER.
230 Now that's bad enough if it's a panel, but when that widget is on the
231 desktop, ITS THE ENTIRE DESKTOP! Of course, when it's a dynamically
232 updating plasmoid such as a temperature or CPU activity gauge, guess
233 what, you're now repainting the entire desktop at every update of that
234 plasmoid. And if there's several such plasmoids...
235
236 That's bad enough as it is, but when it's just the bare desktop, still
237 tolerable. But now consider what happens when that's being filtered up
238 thru multiple layers of semi-transparent windows! No *WONDER* people
239 with older or not well accelerated graphics cards are having issues! And
240 on a desktop the size of mine, say 1920x2200 after the panels top and
241 bottom are removed, still running on a vintage Radeon 9200, that's a HUGE
242 performance issue! No WONDER I was having problems with it!
243
244 According to asegio's blog, he's committed fixes for both 4.4 trunk and
245 the 4.3 branch, which should hit 4.3.1.
246
247 So now I'm looking forward to 4.3.1, to see if I can put widgets back on
248 the desktop again.
249
250 But meanwhile, its the stack of bugs such as this, that really shouldn't
251 be appearing in an X.0 release let alone X.3, that's distressing. And
252 it's even /more/ distressing when support for the previous very stable
253 version is being dropped, before the current version even gets up to
254 normal X.0 version quality, let alone the X.1 that many wait for before
255 they consider it safe to switch.
256
257 Still, regardless of the problems in version handling and premature end
258 of support for earlier versions, good progress /is/ being made, and as
259 I've said, I expect 4.4 to finally be what 4.0 should have been. with 4.5
260 finally being well polished and ready for virtually everyone, thus
261 replacing 3.5. There's very good indications that 4.4 will meet that
262 prediction, as should 4.5, and the finding and fixing of this bug is one
263 of them.
264
265 --
266 Duncan - List replies preferred. No HTML msgs.
267 "Every nonfree program has a lord, a master --
268 and if you use the program, he is your master." Richard Stallman

Replies

Subject Author
Re: [gentoo-amd64] Re: Heads-up: KDEers: Particularly kde3-ers, Volker Armin Hemmann <volkerarmin@××××××××××.com>