Re: problems with Objective-C++
Re: problems with Objective-C++
- Subject: Re: problems with Objective-C++
- From: Ingvar Nedrebo <email@hidden>
- Date: Tue, 22 Jan 2002 12:12:59 +0000
On Monday, January 21, 2002, at 08:47 , Simson L.Garfinkel wrote:
It has been commented on this mailing list that Objective-C++ takes 20x
longer to compile a file than Objective-C or C++, but nobody has ever
said why or what to do about it.
It has been said why a couple of weeks ago on this list. Check the
release notes for 10.1 ObjC++, and add -cpp-precomp to the CFLAGS in
your target build settings. This will speed up your compile and reduce
the object file size of your .mm files.
I.
I am working on a large project that involves Objective-C and C++. I had
wanted to use Objective-C++. Changing the extension of an Objective-C
file from .m to .mm I saw the size of each .o file balloon from
approximately 200k to 6M! I saw compile times go from 2-3 seconds to
30-60 seconds!
This was unacceptable.
So what I have done is I have tried to segregate the cross between the
Objective-C world and the C++ world to as few areas as possible. right
now it is in 2 classes. These are the only two that are .mm files; the
rest are .m files. These are the two classes that have C++ objects in
their instance variables. There is no problem messaging these classes
from .m files, so it's a huge win, really. If other methods need to call
C++ classes but not have C++ objects as instance variables, I put all of
those methods into a separate .mm file that is done as a category.
All of this works, but it is kind of difficult.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.