This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Slow "=" operation problem
- From: Gang Chen <gchen at IfA dot Hawaii dot Edu>
- To: Ian Lance Taylor <ian at airs dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 26 Jan 2005 16:50:52 -1000 (HST)
- Subject: 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
>