POV-Ray : Newsgroups : povray.off-topic : Questionable optimizations : Re: Questionable optimizations Server Time
5 Sep 2024 13:11:14 EDT (-0400)
  Re: Questionable optimizations  
From: Slime
Date: 18 Jul 2009 16:13:43
Message: <4a622cf7$1@news.povray.org>
Let's say I wrote a macro that does something that happens to be useful to 
me, along these lines:

#define DO_USEFUL_STUFF( OBJECT ) if ( OBJECT ) OBJECT->usefulMethod();

Now, I go and use this macro in different places. In some places, the object 
passed is likely to be NULL. In others, it's not. I would be glad that the 
compiler is optimizing out the unnecessary checks for me, while still 
letting me benefit from the general usefulness of my macro.

Of course this is a contrived example, but it's probably not too far from a 
real use case.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.