RE: VC.NET 'Optimization'

"Lewin, Gareth" <[email protected]> Tue, 12 Apr 2005 14:11:43 -0700
Newsgroups gmane.games.devel.windows
Message-ID <[email protected]>
Again, the order doesn't matter, the fib function has no side effects.

His goal in this specific case is to measure the speed of his fib
function, so contextually changing the order the params are passed will
work.

If the order mattered, then fib would have been called outside the
printf scope. 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Grills, Jeff
Sent: Tuesday, April 12, 2005 12:17 PM
To: [email protected]
Subject: RE: [GD-Windows] VC.NET 'Optimization'


Maybe on some compilers, but it's not guaranteed.  The order of argument
evaluation to functions is not specified by the C++ standard - it's left
up to the implementations.

j

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Lewin, Gareth
Sent: Tuesday, April 12, 2005 2:02 PM
To: [email protected]
Subject: RE: [GD-Windows] VC.NET 'Optimization'

I fail to see why this worries you, the optimiser is making a (valid)
assumption about your code, and generating the fastest sequence it can.

As a side note, just flip the order of your params to printf, that
should give you want you want. 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
yogiwp
Sent: Tuesday, April 12, 2005 11:52 AM
To: [email protected]
Subject: Re: [GD-Windows] VC.NET 'Optimization'

> ----------------------------------------------------
>     timer.Restart();
>     printf( "time=%f, result=%d\n", timer.GetElapsed(), fibonacci(42) 
> );
> ----------------------------------------------------


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide Read honest & candid
reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=ick
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU5



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU5