tag:blogger.com,1999:blog-6144115306124694421.post7969817107948810771..comments2023-05-11T15:35:55.769+03:00Comments on Rivo's blog: Iconcache statusRivo Lakshttp://www.blogger.com/profile/06873873820115729073noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-6144115306124694421.post-91836419960828067492007-08-22T20:45:00.000+03:002007-08-22T20:45:00.000+03:00Thanks for explaining your solution. I guess not l...Thanks for explaining your solution. I guess not looking at the code, I made the worst case assumption. My bad.<BR/><BR/>And thanks for all your work on KDE.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6144115306124694421.post-33678359251719554092007-08-19T13:36:00.000+03:002007-08-19T13:36:00.000+03:00Ok, here's a bit more detailed description about h...Ok, here's a bit more detailed description about how this polling works:<BR/>There are actually no timers involved. Updates to the icon theme are checked for in the KIconCache::find() method. So when an icon is requested from the cache (that's what find() does), then it checks if more than 5 seconds has elapsed since updates were last checked for. If that's true, then it actually looks at the icontheme directories to see if they've changed.<BR/>That means that when application is just sitting there doing nothing, it doesn't do any polling at all. Only when you e.g. open a menu and some icons have to loaded does it check for dir updates.<BR/>Also, the "polling" is done not per-application but per-system, so if application A checked for updates 2 seconds ago then app B will notice that and won't check for updates itself.<BR/>So even with 20 apps running, updates are checked for at most every 5 secs (usually even less often) and cpu is never woken up just to check for updates.<BR/>I hope it made things a bit more clear :-)<BR/><BR/>About doing it via theme manager: it doesn't cover the case where you install an application that adds or updates some icons.<BR/><BR/>And thanks for the tip, I'll look into using inotify or KDirWatcher.Rivo Lakshttps://www.blogger.com/profile/06873873820115729073noreply@blogger.comtag:blogger.com,1999:blog-6144115306124694421.post-25114670338500216772007-08-18T14:45:00.000+03:002007-08-18T14:45:00.000+03:00Thanks very much for all your work on the icon cac...Thanks very much for all your work on the icon cache.<BR/>Every optimisations are always welcome!<BR/>I can't wait KDE 4, that will be way snappier!<BR/><BR/>But I'm worried about the 5 seconds polling.<BR/><BR/>If I understand it well, every application do a polling on their own, isn't it?<BR/><BR/>Since they are not launched all at the same time, they poll each at different times. And that polling is only useful arround 1 or 2 times a month, when something changes!<BR/><BR/>On my desktop I currently have arround 20 KDE applications (counting system tray applications, the few I have on the taskbar and the desktop).<BR/>On average, every 5 seconds, 20 applications will do a polling. It means the CPU will be woke up on average 4 times per second?!<BR/><BR/>Am I wrong?<BR/><BR/>KDE developers made all their possible for the clock applet to not wake up the CPU every seconds (if seconds are not displayed) to be able to save laptop power. Those efforts would be ruined by the icon cache.<BR/><BR/>If I'm right, could you try to see how to use inotify or KDirWatcher?<BR/><BR/>KDirWatcher should work on top of inotify on Linux, dnotify or FAM on other platforms, and perhapse Windows equivalent technology on Windows. It was buggy on KDE 3, but I think they solved issues in KDE 4. Or at least I praise so, because services like Striggi and Nepomuk need to strongly rely on this sort of notifications.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6144115306124694421.post-11188897442451667902007-08-18T05:28:00.000+03:002007-08-18T05:28:00.000+03:00Thanks for the clarification. (I posted the 3rd co...Thanks for the clarification. (I posted the 3rd comment) Now I better understand the purpose of polling.<BR/><BR/>Just a suggestion/remark/observation... Amarok has mechanism whereby they monitor folders for changes to keep an updated database of songs. I think it is called inotify. A quick google search led me to http://www-128.ibm.com/developerworks/linux/library/l-inotify.html.<BR/><BR/>Not sure if it is relevant and/or useful. If none, atleast a good article.<BR/><BR/>Thanks for all the work. :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6144115306124694421.post-69533904323408397522007-08-18T01:54:00.000+03:002007-08-18T01:54:00.000+03:00As it has been said, maybe the KDE theme manager ...As it has been said, maybe the KDE theme manager could be modified so that it sends a signal when a theme is changes/icon set is installed, and your program could act upon that signal in order to avoid the polling. (though that might be actually more resource intensive...dunno actually).<BR/><BR/>Or you could hack the theme manager so that it automatically triggers a icon cache flush(trough a d-bus call maybe?),making the polling unnecessary.<BR/><BR/>Since I'm not actually a good coder, I'm just throwing ideas around here :) .<BR/><BR/>PS: Thank you for the great job with the icon cache. Improving software speed is something that is always looked upon as a great thing(at least by me), and having a fast KDE4 makes a lot of us happy :) . Good job !Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6144115306124694421.post-5666658388357360792007-08-17T22:22:00.000+03:002007-08-17T22:22:00.000+03:00Awesome work! Thank you so much for your contribu...Awesome work! Thank you so much for your contributions.<BR/><BR/>I still don't quite understand why the icon themes need to be polled. As the first poster said, why not just flush the caches when the theme is changed via the theme manager? And maybe check once on KDE startup, if it's been changed from outside KDE or something.<BR/><BR/>Every 5 seconds is ok I guess, but as a laptop user, I would really like this kind of polling to be minimized/eliminated.Leo Shttps://www.blogger.com/profile/02951281972056927807noreply@blogger.comtag:blogger.com,1999:blog-6144115306124694421.post-226907681260574932007-08-17T22:01:00.000+03:002007-08-17T22:01:00.000+03:00You got it a bit wrong. The polling is what discov...You got it a bit wrong. The polling is what discovers that the icon theme has been changed or modified and as a result the icon cache discards itself. There's no separate application/daemon/whatever deleting the cache when the theme is changed, it's the cache itself.Rivo Lakshttps://www.blogger.com/profile/06873873820115729073noreply@blogger.comtag:blogger.com,1999:blog-6144115306124694421.post-16635889525687196772007-08-17T21:32:00.000+03:002007-08-17T21:32:00.000+03:00Great work! Congratulations on completing everythi...Great work! Congratulations on completing everything you planned for.<BR/><BR/>Regarding your reply in the previous comment - if changing icon theme or installing new icons automatically flushes the cache then what is the use of polling (even if atmost once every 5 seoncds)? After all, its rare that icon themes are changed after the initial setup and configuration by a user.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6144115306124694421.post-33828838958013622142007-08-17T20:16:00.000+03:002007-08-17T20:16:00.000+03:00I consider it quite complete and if I manage to ge...I consider it quite complete and if I manage to get the last few things done then I don't have any bigger things/ideas left. But if I'll get some, maybe I'll continue working on it, we'll see.<BR/><BR/>Icon themes are polled no more than once every 5 secs and the cache will be automatically discarded when you change icon theme or install new icons, so manual discarding isn't necessary (but is possible).<BR/><BR/>And yes, after finishing up with soc stuff, I hope to do some kwin hacking again. And maybe another video for beta2 :-)Rivo Lakshttps://www.blogger.com/profile/06873873820115729073noreply@blogger.comtag:blogger.com,1999:blog-6144115306124694421.post-64032690368270044842007-08-17T19:47:00.000+03:002007-08-17T19:47:00.000+03:00Great work! Will you continue to work on this afte...Great work! Will you continue to work on this after the benchmarking etc, or do you consider your work now complete?<BR/><BR/>Also, how frequently are the installed icon themes polled, and how disruptive is this polling (i.e. CPU and hardisk usage; duration of polling; etc)? Can it be manually triggered via the KDE Theme Manager when a new theme is added?<BR/><BR/>And will you be working on kwin_composite (*drools* :)) some more when you've finished here? ;)Anonymousnoreply@blogger.com