Mail Archives: djgpp/1997/07/14/11:51:02
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.
- Raw text -