Classes declared Final still use virtual functions

Monkey Targets Forums/Desktop/Classes declared Final still use virtual functions

Shinkiro1(Posted 2013) [#1]
So by default all methods of a class get declared virtual when compiled to c++.

But when I explicitly declare them Final in monkey shouldn't they be declared NOT virtual? (as they won't get extended anyway). Same with Methods btw.


Rone(Posted 2013) [#2]
It would be great... if that were so


Shinkiro1(Posted 2013) [#3]
Don't know .. should this be considered a bug?

PS: It may not be a big deal, but declaring functions virtual means the compiler can't inline them which would be nice for classes like vectors.

Here a quote from Stackoverflow's member Crashworks:

Then I set up three 1024-vector arrays of these things (small enough to fit in L1) and ran a loop that added them to one another (A.x = B.x + C.x) 1000 times. I ran this with the functions defined as inline, virtual, and direct function calls, and the results were:

inline: 8ms
direct: 68ms
virtual: 160ms