ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Optimizing Linux System Performance
Subject:   the proper tool can do it for you
Date:   2007-06-15 07:29:45
From:   horsh
1. The suncc compiler of sunstudio 12 produces the follwoing assembly code for the first example:


main:
push %ebp
movl %esp,%ebp
subl $12,%esp
push $100055
push $5
push $.L21
call printf
leave
ret


The loop is just not present there.
So leave the simple things for your compiler.


2. gprof wants you to recompile your code with an additional flag. collect and er_print (or analyzer instead of kprof) of sun studio can do the same without recompilation.