Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / December 2005



Tip: Looking for answers? Try searching our database.

CW 10 has a better optimiser ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jo Meder - 20 Dec 2005 01:20 GMT
Hi,

I've seen a couple of people say that CW 10 has given their processor
intensive code quite a boost. Can anyone confirm this ? My app is a
renderer, so it's about as processor intensive as they come. The current
version is CFM and still supports OS 9, and it's not going to be updated
for Intel ( we have a brand new app superceding it, which is Mach-O and
Universal ). If CW 10 does provide a bit of performance boost I would be
happy to drop $99 for it and recompile my app to save my users some time.

Regards,

Jo Meder
Paul Russell - 21 Dec 2005 09:26 GMT
> Hi,
>
[quoted text clipped - 5 lines]
> Universal ). If CW 10 does provide a bit of performance boost I would be
> happy to drop $99 for it and recompile my app to save my users some time.

It's not quite as simple as one optimizer being better/worse than
another - it depends greatly on the nature of the code that's being
optimised. But yes, there are still certain cases where CW can beat gcc
(although gcc 4.0 has closed this gap considerably). You're probably
only looking at say ~10% best case versus gcc 3.3, and there may even be
some routines where gcc does better than CW. So the bad news is that you
really need to try both compilers with your code and see if there's any
significant difference.

You might also want to take a look at IBM's xlc if you really need to
squeeze avery last ounce of performance out of your code.

Paul
Alwyn - 21 Dec 2005 22:29 GMT
> > I've seen a couple of people say that CW 10 has given their processor
> > intensive code quite a boost. Can anyone confirm this ? My app is a
[quoted text clipped - 8 lines]
> optimised. But yes, there are still certain cases where CW can beat gcc
> (although gcc 4.0 has closed this gap considerably).

I think the OP's question is whether it is worth his while upgrading
from an earlier version of CodeWarrior to version 10 for the extra
optimisation it might give.

I don't know about the optimisation but would remind any prospective
buyer that CW 10 for Macintosh is sold without support and will not be
updated further. So you will have to work around any bugs you find on
your own account.

Alwyn
Paul Russell - 22 Dec 2005 09:48 GMT
> I think the OP's question is whether it is worth his while upgrading
> from an earlier version of CodeWarrior to version 10 for the extra
[quoted text clipped - 4 lines]
> updated further. So you will have to work around any bugs you find on
> your own account.

Ah - mea culpa - I wasn't paying enough attention and assumed the OP was
asking about CW versus gcc.

In that case I doubt that he'll see any performance difference with CW
10. I haven't noticed much improvment in code optimization in CW since
it peaked at around version 5.3.

Paul
nlenz@bezeqint.net - 23 Dec 2005 11:05 GMT
My program, Bugs On The Run (available with source code on
versiontracker), runs 2x faster with CW10 than
with CW8.3 or xcode 2.2 for the core algorithm.
However, in graphics intensive mode it runs 2x faster in xcode
than with CW10, and the same speed between CW8.3 and CW10.
If you download it - you can directly compare the CW10 version with
the xcode version, since the projects are included along
with others (CFM, Mach-o, etc).

Noam
Paul Russell - 23 Dec 2005 11:44 GMT
> My program, Bugs On The Run (available with source code on
> versiontracker), runs 2x faster with CW10 than
[quoted text clipped - 4 lines]
> the xcode version, since the projects are included along
> with others (CFM, Mach-o, etc).

Are you using gcc 3.3 or 4.0 with Xcode 2.2 ?

Paul
Noam Lenz - 23 Dec 2005 15:13 GMT
I use GCC 4.0.

Noam
Paul Russell - 23 Dec 2005 23:41 GMT
> I use GCC 4.0.

I profiled your code with Shark and it looks like 90% of the time is
spent in QD/Quartz, so I'm not sure how the compiler can make much
difference ?

Paul
Noam Lenz - 24 Dec 2005 00:02 GMT
Maybe the carbon libraries which QD uses is different and therefore
more optimized in one case rather than the other. (in CW vs. xcode).

Noam
Paul Russell - 24 Dec 2005 11:45 GMT
> Maybe the carbon libraries which QD uses is different and therefore
> more optimized in one case rather than the other. (in CW vs. xcode).

I wouldn't have thought so - they're just the standard frameworks, no ?

Anyway, one thing you could do to speed up your app is to reduce the
amount of drawing that you do. There's no point trying to redraw your
window more than, say, 10 or 20 times a second - the human eye can't
perceive the difference. So you could keep track of the last window
update time and only update the window if the elapsed time is greater
than some threshold (e.g. 50 ms). That should help performance a lot in
the faster modes (e.g. "Turbo", where it looks like you're trying to
redraw at around 200 fps even on my lowly G4 Powerbook).

Regards,

Paul
Noam Lenz - 24 Dec 2005 23:43 GMT
I just found out that I used the 10.3.9 SDK path in the CW version -
(fast hyper, slow turbo), and the 10.4u target SDK in my xcode
version (fast turbo, slow hyper). If I exchange the SDKs in either
CW or xcode I get consistent results.
The bottom line is that it all depends on the SDK path: to get
fast hyper - use the older 10.3.9 SDK, and to get faster turbo use
the 10.4u SDK.  Otherwise the two compilers CW and GCC 4.0
give exactly the same results. (for those who don't know hyper =
core algorithm at max speed, turbo =fastest graphics (QD) speed).

About the refresh rate, you can adjust it via the slider or
preferences.
Of course I could have decided to draw only once every few iterations
and thereby achieve more iterations per second at the expense of
fewer graphic frames per second, and may do so as an option in a
future release.
Thanks for the ideas.

Noam
Jo Meder - 25 Dec 2005 10:18 GMT
Hi Noam,

> I just found out that I used the 10.3.9 SDK path in the CW version -
> (fast hyper, slow turbo), and the 10.4u target SDK in my xcode
> version (fast turbo, slow hyper). If I exchange the SDKs in either
> CW or xcode I get consistent results.

I think these is some kind of optimisation in the graphics stuff,
coalesced updates or something, which is only enabled when you link to a
certain version of the SDKs. I don't remember the exact details, but I
think it was discussed on the Apple carbon-dev list.

Regards,

Jo Meder
Noam Lenz - 25 Dec 2005 18:05 GMT
> Hi Noam,
>
[quoted text clipped - 11 lines]
>
> Jo Meder

Thanks for the info, Jo.
I will look it up.

Noam
Steven Fisher - 23 Dec 2005 19:32 GMT
> My program, Bugs On The Run (available with source code on
> versiontracker), runs 2x faster with CW10 than
[quoted text clipped - 4 lines]
> the xcode version, since the projects are included along
> with others (CFM, Mach-o, etc).

That's VERY interesting data. Thanks for posting it.

Signature

Steven Fisher; sdfisher@spamcop.net

Noam Lenz - 23 Dec 2005 22:28 GMT
You're welcome.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.