Re: Slow "=" operation problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gang Chen <gchen@xxxxxxxxxxxxxx> writes:

> It looks that the storing part ("=" operation) takes much longer time than
> the multiplying part ("*" operation). You can see this from the running
> time with the propram only has "line 1", "line 2", or "line 3". The
> corresponding time is attached at the end of every line.

If you are compiling with optimization, then your numbers are
deceptive.  When you compile the loop with only the multiplication,
the compiler will see that the result of the multiplication is not
used (it is not stored anywhere), and the entire multiplication will
be removed.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux