This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Performance, for(int i...) vs for(i...)
- From: Ian Lance Taylor <iant at google dot com>
- To: lab at kayohamid dot net
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sun, 26 Aug 2012 10:12:35 -0700
- Subject: Re: Performance, for(int i...) vs for(i...)
- References: <fe1f0e52d985ec050e9f8ce74ae7c0e2@kayohamid.net>
On Sun, Aug 26, 2012 at 8:30 AM, <lab@kayohamid.net> wrote:
>
> the result of forin.c and forout.c is the same:
You are compiling without optimization. If you are interested in
performance, use the -O2 option.
> Seeing this, can I say that using int inside the for or outside for is the
> same? Have no difference on performance?
Correct: it has no difference in performance. Why would it?
Ian