• 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: MacIntel apps behaves weirdly when compiled with -02 not -01 - Almost solved(auto-vectorization issue)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MacIntel apps behaves weirdly when compiled with -02 not -01 - Almost solved(auto-vectorization issue)


  • Subject: Re: MacIntel apps behaves weirdly when compiled with -02 not -01 - Almost solved(auto-vectorization issue)
  • From: Eric Albert <email@hidden>
  • Date: Fri, 13 Jan 2006 12:55:39 -0800

On Jan 13, 2006, at 12:01 PM, Mark Wagner wrote:

On 1/13/06, Olivier Tristan <email@hidden> wrote:
Os do not remove some optims  as written in the doc ?
I don't reallly care if the binary is 10% bigger. Only CPU usage is
important in audio apps :)

This was true back in the days of small CPU caches and fast memory access. Now, with large CPU caches and CPUs that run much faster than main memory, if you can make the application small enough that the processing loop fits entirely within the L2 cache (or better, the L1 cache), then the application will run faster than a more heavily optimized one that needs to access main memory for program code.

Exactly. We've found over and over that -Os produces better overall system performance than -O2 or -O3 because it generates smaller code, and smaller code typically results in better performance than faster but larger code. That's why -Os is the default in Xcode.


Some specific CPU-intensive algorithms can benefit from -O2 or -O3, of course. But as always, the best way to figure out things like that is to find the parts of your code that aren't performing as well as you'd like, measure them with Shark, and then figure out how to improve their performance. Sometimes compiler flags will be the solution there, but often algorithmic changes will improve things even more.

-Eric

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


References: 
 >MacIntel apps behaves weirdly when compiled with -02 not -01 (From: Olivier Tristan <email@hidden>)
 >Re: MacIntel apps behaves weirdly when compiled with -02 not -01 (From: Eric Albert <email@hidden>)
 >Re: MacIntel apps behaves weirdly when compiled with -02 not -01 - Almost solved(auto-vectorization issue) (From: Olivier Tristan <email@hidden>)
 >Re: MacIntel apps behaves weirdly when compiled with -02 not -01 - Almost solved(auto-vectorization issue) (From: Eric Albert <email@hidden>)
 >Re: MacIntel apps behaves weirdly when compiled with -02 not -01 - Almost solved(auto-vectorization issue) (From: Olivier Tristan <email@hidden>)
 >Re: MacIntel apps behaves weirdly when compiled with -02 not -01 - Almost solved(auto-vectorization issue) (From: Mark Wagner <email@hidden>)

  • Prev by Date: Re: Project doesn't link to correct subproject
  • Next by Date: [FAQ] Xcode 2.2 Project Doesn't Compile C++ as C++ [was: How does Xcode decide whether to use g++ for linking or gcc]
  • Previous by thread: Re: MacIntel apps behaves weirdly when compiled with -02 not -01 - Almost solved(auto-vectorization issue)
  • Next by thread: Re: MacIntel apps behaves weirdly when compiled with -02 not -01
  • Index(es):
    • Date
    • Thread