Plasma uses a lot of files from disk, particularly when using QML and scripted Plasmoids, but also whenever something requests an image from the theme. The Package class is responsible for the former functionality and the Theme class for the latter. We already cache the results of the Theme rendering, but not the results of looking around on disk for the requested image. There is essentially hekman furniture no caching at all for Package: every request for a file sends it looking on disk for it. The impact of this is relatively low thanks to caching by the operating system, but it isn't negligable. When we start thinking of smaller devices it becomes even less negligable. So while working on libplasma2 I decided something needed to be done. This past week I started a refactoring of the Package classes so that less memory hekman furniture was used, both by using a smaller data structure on devices hekman furniture and by using an implicitly shared pointer for the private data (which improves things on all targets, including the desktop). PackageStructure went from being a data bearing class to a mutator of Package, which allows them to be properly hekman furniture shared between Package hekman furniture objects. I then added a lookup cache to Package. The result was that the copy test (100k copies and deletions) went from ~2700ms to ~37ms, while 100k copies, file lookups and deletions went from ~3900ms to ~40ms. All while the memory footprint shrunk. Unfortunately, this isn't really backportable to libplasma1 as the changes that were required to achieve hekman furniture this were significant. hekman furniture These changes were on top of previous changes made in the refactoring hekman furniture of Package and PackageStructure which drew the data "closer" to Package and cut out a lot of collection creation and copying. So reasonably good wins there. Theme also got a lookup cache, and the good news is that this is backportable and has, in fact, been cherry picked into both the 4.7 and master (will be 4.8) branches. There the results were striking as well: 100k lookups of 3 different files in the theme dropped from a little over 6 seconds to ~1/4th hekman furniture of a second. That's an order of magnitude improvement. Unlike with Package, overall this will end up taking a little more memory, but we're talking about a few kilobytes at most which isn't particularly significant compared to the time savings. Since Theme is used heavily and the same SVGs are asked for over and over again during a Plasma applications execution, this should have some very nice impacts at runtime. I still haven't done the screencasts and snapshots I need to for my Share Like Connect blog entry, but I was busy today finishing this stuff up ... and attending telco or two, and doing presentation prep for next month and dealing with the construction people who put in the new decking today... so the usual distractions. hekman furniture :)
I was really discouraged by the finland hekman furniture talk about resource usage in KDE SC, it seemed like people only care for big desktop machines. I really hope this kind of work will be made across the board when KDE SC has to run on small devices. After years of using KDE SC on my netbook I finally had to switch to LXDE because performance is just way way better. I really hope I can go back when KDE5 is ready. hekman furniture As a general rule I would like to see something like: If new component hekman furniture in KDE SC does not feature reduced resource usage it should be considered a bug. Apple and MS seem to (mostly) do the same. Keep up the great work 22/7/11 19:08
@Tom: keep in mind that one of the biggest issues with Plasma Netbook on many netbooks is *graphics performance*. try running the plasma-netbook binary with -graphicssystem raster ... until Qt does a better job on rendering on that kind of hardware (which hopefully hekman furniture Qt5 will with their new focus on GL ..) all the optimizations of the sort in this blog won't help a lot in the common netbook performance problem case. 22/7/11 19:27
@Aaron: Thanks a lot for the tip. I will keep it in mind when I will install a new distro with 4.7 in fall/winter. My initial conclusion to the performance problems I had was that the SSD on my EeePC 901 is too slow and 1 GB of RAM is too little to open a lot of tabs in the browser (that is when I got into serious performance hekman furniture problems). LXDE seems to use a lot less RAM and therefor copes better with lots of open tabs. But I could be wrong. 22/7/11 19:56
@Tom: KDE4 and 1GB RAM certainly didn't play together well in the past — I remember more than about two konqueror tabs causing big slowdowns when I was between giving away one stick of RAM and installing new sticks. That was KDE 4.4 or something though; don't know if it's improved. 22/7/11 20:19
exactly, kde need some love under the hood (not only trillions new plasmoids and eye-candy), focus on bugs, performance, usability hekman furniture and users! there are many interesting ideas on kde brainstorm waiting for implementation :) also there is no real reason why kde shouldn't work on "older" PC's with 1GB of memory - it w
No comments:
Post a Comment