From: eyal DOT ben-david AT aks DOT com To: tudor AT cam DOT org cc: djgpp AT delorie DOT com Message-ID: <422564D4.005B35AA.00@aks.com> Date: Mon, 14 Jul 1997 18:48:07 +0200 Subject: Re: OPTIMISATION PROBLEMS! UGH!!! Mime-Version: 1.0 Content-type: text/plain; charset=US-ASCII Precedence: bulk On 7/13/97 3:49:14 AM Vic wrote: >I need basic tips on optimising code....things my stupid brain can >swallow... >I was doing something..and it clipped at around 150000 polys per >second....then I added ONE inline declaration to a function and it >jumped at around 200000!! 50000 polys with one __INLINE__. UGH! >are function calls THAT slow? >confused, >-- It depends. If the function doesn't do much such as accessors and mutators SetValue(..); GetValue(); then inline functions might help you a lot. It will also save some space since the trivial code is inserted instead of pushing parameters make the call and release the stack (overhead of a real functions). In some situations where the function is called many (millions of ??) times this also helps. Generally most functions are not so small or trivial so the overhead of making a call is negligible compared to the overall time spent inside the function. In these cases inline functions will cause a code bloat without significant performance gain. Eyal.