• 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: Slow and bloated?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slow and bloated?


  • Subject: Re: Slow and bloated?
  • From: Scott Judd <email@hidden>
  • Date: Sun, 25 Jul 2004 20:08:52 -0500

Clearly gcc handles Objective-C++ compilation differently than Objective-C, but I was kind of hoping that I could offer up a suggestion here. Hopefully, what I *didn't* find could prove useful instead. :P

I just ran the example that Allan posted and fed it through ktrace, thinking that maybe it would yield another clue for the Obj-C++ case. The kernel dumps were identical for both cases.

FYI - I ran the examples verbatim from the example below, using gcc-3.3 from the command line. I tried both 'gcc' and 'g++', and in each case, I wound up with very similar results to the ones that Allan posted.

It's pretty easy to conclude that gcc could use some serious optimization for compiling Objective-C++. Unfortunately, I would kind of doubt that optimizing gcc for Obj-C++ compile times is high on the agenda of the Apple engineering team, for fairly obvious reasons.

Incidentally, a glance at the man page for gcc indicates that pch is disabled when compiling ObjC++ code. I would imagine that this would account for most (if not all) of the time discrepancy, but I wasn't able to prove that assumption.

scott

On Jul 24, 2004, at 11:59 PM, Allan Odgaard wrote:

On 25. Jul 2004, at 6:04, Brent Gulanowski wrote:

Maybe you all need more RAM.

I have 645 MB free after a test compile and 0 MB loaded from the swap file, so I assume I'm good...


Compiling say a 500 line source file for me is nearly instantaneous. I
can compile a 50k-line project from clean in under a minute. I can
build Adium (deployment), with 1000+ files, in six minutes.

What??? You can compile 50,000 lines of source in under a minute? How many lines are Adium? And is it really 1,000+ files?


I created this file:

   #import <Cocoa/Cocoa.h>
   int main (int argc, char const* argv[])
   {
      return 0;
   }

And saved it as both tst.m and tst.mm, here are the timings:

% time g++ -Os -c tst.m
1.790u 0.550s 0:02.42 96.6%     0+0k 0+10io 0pf+0w
% time g++ -Os -c tst.mm
3.400u 0.800s 0:04.72 88.9%     0+0k 0+11io 0pf+0w

As can be seen, ObjectiveC++ takes, for this small file, twice as long as ObjectiveC.

Furthermore, even this empty files takes two seconds, making your claim of 1,000+ files in deployment mode compile in 6 minutes seem like a distant dream (although the above is w/o pre-compiled headers, which may make a lot of a difference, but my 18 KLOC project still takes in the order of 20 minutes for the deployment build, and that is with precompiled headers, but as said, also using a lot of ObjectiveC++, which I think is where GCC has the biggest problem)...
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Slow and bloated?
      • From: "Theodore H. Smith" <email@hidden>
References: 
 >Slow and bloated? (From: "Theodore H. Smith" <email@hidden>)
 >Re: Slow and bloated? (From: Nick Zitzmann <email@hidden>)
 >Re: Slow and bloated? (From: Allan Odgaard <email@hidden>)
 >Re: Slow and bloated? (From: Nick Zitzmann <email@hidden>)
 >Re: Slow and bloated? (From: Brent Gulanowski <email@hidden>)
 >Re: Slow and bloated? (From: Allan Odgaard <email@hidden>)

  • Prev by Date: Re: How can I get the source code?
  • Next by Date: AppleScript date
  • Previous by thread: Re: Slow and bloated?
  • Next by thread: Re: Slow and bloated?
  • Index(es):
    • Date
    • Thread