Re: Java vs C/Objective-C performance question
Re: Java vs C/Objective-C performance question
- Subject: Re: Java vs C/Objective-C performance question
- From: Dietrich Epp <email@hidden>
- Date: Mon, 17 Mar 2003 03:43:41 -0800
On Monday, March 17, 2003, at 01:23 AM, Chris Ridd wrote:
On 17/3/03 9:01 am, Dietmar Planitzer <email@hidden> wrote:
1) Always compile ObjC code with all optimizations turned on. By
default PB compiles the code with all optimizations turned off which
means that gcc will produce horribly bad code.
It is peculiar that gcc doesn't seem to optimize away that first set of
nested loops, even using -O3.
Perhaps gcc always produces horribly bad code :-)
<sarcasm>Right... which is why it always does so horribly on
performance tests...</sarcasm>
Seriously though, you just got to know GCC command options. -O3 is
nothing more than bland, generic optimization.
I tested it out with -funroll-loops. Funny, these results. It unrolls
the inner loop 20 times, then reduces the 20 +1s to a single +20, but
doesn't unroll it any farther. -frerun-loop-opt doesn't do anything,
maybe it doesn't apply to loop unrolling (which makes sense).
li r3,0
li r11,0
L16:
li r9,0
L15:
li r2,500
mtctr r2
L63:
addi r3,r3,20
bdnz L63
addi r9,r9,1
cmpwi cr0,r9,9999
ble+ cr0,L15
addi r11,r11,1
cmpwi cr0,r11,9
bgtlr- cr0
b L16
_______________________________________________
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.