Showing posts with label rant. Show all posts
Showing posts with label rant. Show all posts

Friday, August 24, 2018

I Can't Believe Some People Still Need Virtual Method Calls Defended

In the 1990's, a lot of people labored until the belief that indirect (virtual) method calls were expensive. After all, you have to read a value out of memory and then use that as the address of a call! How could it ever compete with the one-clock-tick-long conditional jump?

I hear this less today but I still hear it every once in a while and I'm shocked when I do because it was nonsense, even in the late nineties.

In terms of performance, it didn't matter, then, and it doesn't matter, now. I'm only addressing it because a belief that discourages the usage of virtual methods is a dangerous one which must be disabused.