Finding large difference b/w execution time of c++ and D codes for same problem

Marco Leise Marco.Leise at gmx.de
Wed Feb 13 06:29:56 PST 2013


Am Wed, 13 Feb 2013 14:44:36 +0100
schrieb FG <home at fgda.pl>:

> On 2013-02-13 14:26, Marco Leise wrote:
> > template Julia(TReal)
> > {
> > 	struct ComplexStruct
> > 	{
> > 		float r;
> > 		float i;
> > ... 	
> 
> Why aren't r and i of type TReal?

They are actual storage in memory, where every increase in
size hurts. And they cannot be optimized away,
like temporary reals, which can be kept on the FPU stack.

-- 
Marco



More information about the Digitalmars-d-learn mailing list