• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSBundle problem accumulates execution time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: NSBundle problem accumulates execution time
      • From: Kevin Ballard <email@hidden>
References: 
 >NSBundle problem accumulates execution time (From: Michael Monscheuer <email@hidden>)

  • Prev by Date: Re: distributed builds with different kernel versions error
  • Next by Date: Re: NSBundle problem accumulates execution time
  • Previous by thread: NSBundle problem accumulates execution time
  • Next by thread: Re: NSBundle problem accumulates execution time
  • Index(es):
    • Date
    • Thread