• 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: Question: What is the impact of changing .cpp AudioUnitEffect source to .mm
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question: What is the impact of changing .cpp AudioUnitEffect source to .mm


  • Subject: Re: Question: What is the impact of changing .cpp AudioUnitEffect source to .mm
  • From: Brian Willoughby <email@hidden>
  • Date: Mon, 21 Jun 2010 01:22:04 -0700


On Jun 20, 2010, at 12:22, Roni Music wrote:
From: Brian Willoughby <email@hidden>
Subject: Re: Question: What is the impact of changing .cpp AudioUnitEffect source to .mm

On Jun 20, 2010, at 02:05, Motti Shneor wrote:
When is the Obj-C runtime loaded?
How fast is its initialization?
Is it loaded only once for the host application, or is it part of
my own code?
how is it attached to my code?
Is the code compiled for .mm any slower?

Unlike C++, ObjC does not generate any code behind the scenes.

What kind of code does C++ generate behind the scenes?

Huge list:

* copy constructors
* assignment operators
* implicit calling conversion operators or conversion constructors
* virtual function calls
* templates
* general constructors and destructors (even with objects inside innocuous-looking standard C structs)
* operator overloading in general
* inlining, especially constructors
* return of struct/class object by value (this may happen in standard C, too)
* exception handling (ObjC exception macros are probably equivalent, but stand out as #defines)


There are particular problems when C++ function overloading and operator overloading fight each other in the selection process.

Granted, some of these are finitely bounded, but any constructor could easily have a hit that's bigger that an ObjC method call, and the point is that everything must be explicit in ObjC.

I had to solicit some help in putting together this rough list, so I cannot guarantee that it is complete or entirely accurate, but it should serve to give a general idea. The only thing you have to look out for in ObjC is the first method call, and I believe you can completely protect against that by using @select(), although I suppose I cannot guarantee that this is true without more research. ObjC will not allocate automatically, and it will not free them, either, if you avoid the optional GC. Apart from the method call, ObjC generates identical code to standard C, whereas C++ varies wildly and almost unpredictably.

Brian Willoughby
Sound Consulting

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Question: What is the impact of changing .cpp AudioUnitEffectsource to .mm
  • Next by Date: Re: Question: What is the impact of changing .cpp AudioUnitEffect source to .mm
  • Previous by thread: Re: Question: What is the impact of changing .cpp AudioUnitEffect source to .mm
  • Next by thread: Protocol for processing audio data from input and writing to file
  • Index(es):
    • Date
    • Thread