I thought that using 'final' should speed things up just a bit.
but it actually slows it down a little. Strange....
but it actually slows it down a little. Strange....
All Blitz methods are what in C++ would be called 'virtual' - they use dynamic binding at runtime. The assembly code emitted for obj.DoStuff() is the same regardless of whether the method is abstract, final, extended in another type or a combination of those.
If you see a slowdown, it's probably because the GC starts collecting garbage from the first test during the second. Always use GCCollect between tests when profiling!
Edit: Oh, as for the actual question... if the function calling GetSomeField does anything remotely complicated, the overhead from a method call is probably insignificant. Eg. each string concatenation amounts to way more cycles than a method call. Still, why not call it once and store it to a local variable...