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.







_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to