[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: KImgio (Was: App start is too slow)
From:       Waldo Bastian <bastian () kde ! org>
Date:       2000-04-26 23:36:04
[Download RAW message or body]

On Wed, 26 Apr 2000, Stephan Kulow wrote:
> Waldo Bastian wrote:
> > On Wed, 26 Apr 2000, Stephan Kulow wrote:
> > > >   0.6s    dlopening kimg_***.so stuff. why is that necessary during
> > > >           startup? I don't have a single tiff file on my entire hard
> > > > disk, and still it seems to load every plugin it can find.
> > >
> > > Well, you're certainly right, but I can't see how we can help here.
> > > When you first time access a QImage, it looks up the registred image
> > > handlers. So you want to register them as soon as possible. But I
> > > guess, it can be delayed a bit,  but it still has to be done before the
> > > background is displayed (that _could_ be an image). But 0.6s are
> > > definitly worth a bit extra optimization in case a flat background (or
> > > a builtin image type :) is chosen.
> >
> > Isn't it possible to register dummy handlers based on information in the
> > .desktop file and to load the actual lib when you are about to load/save
> > a certain image type?
>
> I'm afraid not that easy, but it could be possible.

I did some tests but having/not having kimgio plugins hardly affects start-up 
performance (It differs about 40ms) . So I don't think we need this for 
start-up performance.

I do think it would be "the right thing" to only load these modules when we 
really need them though. That would mean that we need to read some .desktop 
files instead to find out which image formats are supported. This should not 
take more time than actually loading the libs themselves, because then we 
would only make matters worse.

Information to be stored in the .desktop files is:
1) Type (aka. format, arg 1 of QImageIO::defineIOHandler)
2) Header (arg 2. of defineIOHandler)
3) flags (arg 3. of defineIOHandler)
4) pattern-lines (see KImageIO::pattern()) 
5) Read supported
6) Write supported
7) List of file suffices (Maybe in combination with 4)
8) Mimetype
9) Library to load for this image format

Note that the desktop defines an image format and that a library can be 
shared among several image formats. (E.g. the imagemagick IO lib defines 9 
types.)

Cheers,
Waldo

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic