KIconLoader Optimization Idea

Simon Perreault nomis80 at lqt.ca
Mon Jun 6 16:40:04 CEST 2005


On Sunday 05 June 2005 09:45, Luke Alan Sandell wrote:
> Right now, KDE doesn't have any classes for sharing memory
> between applications (KSharedPixmap seems a bit overkill for 32x32 pixel
> icons), but one could easily be developed using shm_open(). This would have
> the added bonus that applications would not have identical copies of the
> same data, and thus the KApplication memory footprint would decrease.

First, thanks for choosing optimizing KDE as your project. It is very needed 
by KDE and I think Google will like anything optimization-related.

I'd like to comment on the shared memory solution. Shared memory is often very 
scarce. One is usually surprised that there is not enough shared memory on 
this shiny new system for doing this seemingly simple task. So I'm not sure 
shared memory is the way to go, because there are many icons in KDE and it 
will eat a sizeable amount of memory.

Maybe instead you could write a simple socket-based daemon. Protocol: client 
opens socket, writes null-terminated icon filename. Server accepts 
connections, uses cache to retrieve data, writes data on socket, closes 
socket. My guess is that the socket overhead will be negligible compared to 
the amount of time saved by using the cache. Also you could use a select() 
loop so that other queries could be satisfied while there is a cache miss.

That's assuming icon caching is desirable. I'm not an expert in the field of 
KDE optimization so maybe others could comment on that point.


More information about the Kde-optimize mailing list