Re: NSBundle problem accumulates execution time
Re: NSBundle problem accumulates execution time
- Subject: Re: NSBundle problem accumulates execution time
- From: Jason Harris <email@hidden>
- Date: Sat, 5 Feb 2005 23:12:14 -0700
Well, every time through your loop, it's been a longer time interval
since time1 was set. I think you want to set time1 to the new interval
in your loop to come up with a real test.
jason
On Feb 5, 2005, at 6:38 AM, Michael Monscheuer wrote:
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
_______________________________________________
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