KIconLoader Optimization Idea

Gustavo Pichorim Boiko gustavo.boiko at kdemail.net
Mon Jun 6 22:07:48 CEST 2005


Em Monday 06 June 2005 14:30, Friedrich W. H. Kossebau escreveu:
> Am Sonntag, 5. Juni 2005 15:45, schrieb Luke Alan Sandell:
> > Hi, my name is Luke Sandell, and I am a student at Appalachian State
> > University looking for a project to do for Google's Summer of Coding. I
> > had an idea for optimization but I wanted to run it by this group before
> > I decide.
> >
> > My idea deals with the never-ending saga of application startup times.
> > From watching the debug messages while KDE apps are starting up, it seems
> > that a significant amount of time is spent loading icons into memory.
> > This is sad, seeing as the same icons are used across the entire KDE
> > session. It seems to me that this could be avoided by making
> > KIconLoader's internal cache session-global. 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. Additionally, the code developed for
> > this project could be reused for sharing other types of data between KDE
> > apps to the same end.
> >
> > What do you think? If this is not a good idea, feel free to suggest
> > others.
>
> Might be a good think to do, yes :)
>
> I have no clue, but what about a special X server extension which holds the
> icons? My sparse memory suggests me that the icons are hold as elements in
> the X server anyway (QPixmaps) but the problem with sharing between apps
> was IIRC something with having no access control, thus no knowledge whether
> the icons still look like they are supposed. Anybody with more background
> here?

Pixmaps can be shared by the X server, and the implementation I'm working on 
creates a key for the icon (including name, size, etc) and the X pixmap 
handles are associated to this key.

> Martijn's remark concerning KStandardDirs are valid, though. That would
> need some research if this feature is used, at first :)

Well, I use a check to guarantee it is a vanilla KStandardDirs (without any 
custom dir), and if it is not, it doesn't use the icon server.

[]'s

-- 
 Gustavo Pichorim Boiko
 -----------------------------------------------------
  KDE Developer		Computer Science - UFPR    
  Conectiva Labs		gustavo . boiko @ kdemail . net 
 -----------------------------------------------------


More information about the Kde-optimize mailing list