• 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: Library loading policy on Mac OS X with Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Library loading policy on Mac OS X with Cocoa


  • Subject: Re: Library loading policy on Mac OS X with Cocoa
  • From: Eric Peyton <email@hidden>
  • Date: Tue, 26 Jun 2001 08:07:42 -0500

This is not a development question per se but I will take a shot here.

On Tuesday, June 26, 2001, at 06:12 AM, Stiphane Sudre wrote:

I have another stupid question.

I'm running Project Builder under gdb because I need to track a bug which makes it crash.

I just saw something surprising but not too much.

I added a ) without its counterpart and Project Builder beeped to warm me.


Yep, ain't that nice of it :-)

From gdb I can see that to generate the Beep, a shared library got loaded.

Yes.

This may explain why it's so slow to get the first beep on any Cocoa application. But why does Cocoa need to load a whole library at runtime just for NSBeep();

Couldn't it be done once for all at the System Launch, or the Application Launch ?

Because if it loaded it at application launch then *every* application, including those that NEVER make a sound would incur that startup/launch penalty. Everyone wants there apps to launch faster, not slower, and in order to do this, less code needs to be loaded at launch. To get less code loaded at launch some things are loaded lazily (I believe that Appkit loads lots of frameworks lazily, like QuickTime etc.). There is no need for your application to load QuickTime just because it loaded AppKit, even though AppKit does contain QuickTime code. (Loading something like QuickTime plus all it's myriad parts would have a noticeable impact on every app launch - you wouldn't want that now would you :-) )

Eric

_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


  • Follow-Ups:
    • Re: Library loading policy on Mac OS X with Cocoa
      • From: Rosyna <email@hidden>
    • Re: Library loading policy on Mac OS X with Cocoa
      • From: Chris Hanson <email@hidden>
References: 
 >Library loading policy on Mac OS X with Cocoa (From: Stéphane Sudre <email@hidden>)

  • Prev by Date: Re: Send action when textDidChange
  • Next by Date: [semi-OT] ADC Sherlock Plugins
  • Previous by thread: Library loading policy on Mac OS X with Cocoa
  • Next by thread: Re: Library loading policy on Mac OS X with Cocoa
  • Index(es):
    • Date
    • Thread