NSBundle problem accumulates execution time
NSBundle problem accumulates execution time
- Subject: NSBundle problem accumulates execution time
- From: Michael Monscheuer <email@hidden>
- Date: Sat, 05 Feb 2005 14:38:52 +0100
I had some very hard hours to find a bug that slows down my app
dramatically during runtime. The effect accumulates. I did not managed
to find the reason for this.
I created a very simple code snippet to show the problem (attached).
Running it, you will see that with each iteration exection time of
+allFrameworks raises.
I do not know why, but execution time doesn't raise if +bundleForClass:
is called only once or twice for the same class.
Any Idea why this does problem occures?
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
int i,j;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSTimeInterval time1 = [NSDate timeIntervalSinceReferenceDate];
NSLog(@"Starting...");
for (i = 0; i < 100; i++) {
for (j = 0; j< 32; j++) {
[NSBundle bundleForClass:[NSObject class]];
[NSBundle bundleForClass:[NSArray class]];
[NSBundle allFrameworks];
}
NSLog(@"32er time:%f",
[NSDate timeIntervalSinceReferenceDate]-time1);
}
NSLog(@"...finished.");
[pool release];
return 0;
}
Greetings from Germany,
MiMo
--
=======================================================
And refashioning the fashioned
lest it stiffen into iron
is work of endless vital activity.
[Goethe]
mailto:email@hidden
mailto:email@hidden
All about CALAMUS DTP suite:
http://www.calamus.net
=======================================================
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden