This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Slow "=" operation problem


Thank you for your response.

I am sorry that I didn't make it clear.

In fact by "the multiplying part only", I mean storing the results to a
local temperory double variable "tmp" instead of the largest array. You
can see it in the program.

I also tried without optimization, and the difference is still large:
about 10s vs 30s.


On 26 Jan 2005, Ian Lance Taylor wrote:

> Gang Chen <gchen@IfA.Hawaii.Edu> 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]