bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSImage imagedNamed:] and application startup tuning


From: Fred Kiefer
Subject: Re: [NSImage imagedNamed:] and application startup tuning
Date: Tue, 18 Mar 2003 22:00:23 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020903

Michael Hanni wrote:
[NSImage imageNamed:] provides a very easy way to grab images. You can simply
provide a name, minus even an extension, and NSImage will find your image.
However, this can be more intensive than required when you already know your
image's extension. For example, when you strace a gnustep app right now there
are hundreds of attempts to find images -- this method loops through every
possible directory with every possible image extension until it finds the right
one -- used in the AppKit. The time involved is not huge, but it is entirely
unnecessary I think. With the attached patch I've added a '.tiff' extention to
most images loaded in the AppKit.

Not sure if this is the best way to get a better speed at startup. There is even one small drawback, we may on some system have to use the extension of '.tif' if we ever port GNUstep to such a dump platform. So I had to think up something better, and here it is:

Loading the tiff images is so slow because on systems where WRaster is available GNUstep first tries all the formats provided by WRaster before looking for TIFF files. Switching this order around, i.e. looking first for '.tiff', should result in the same speedup. Please test this and give me your comments. If this is not enough we should of course use your patch.









reply via email to

[Prev in Thread] Current Thread [Next in Thread]