close-circle
Close

C++ Virtual Function Are Fast

A project log for Embedding C++

C++ is an efficient language eminently suitable for use in embedded systems but some look for proof of the efficiency. This is the proof.

Rud Merriam 11/13/2015 at 17:460 Comments

Virtual functions are not a problem for embedded systems. Their raw performance nearly matches normal C calls and in an overall system performance can actually be a faster. CODE CRAFT – EMBEDDING C++: TIMING VIRTUAL FUNCTIONS measures C function calls, C pointer to function calls, and C++ virtual calls and finds them taking the same amount of time, for pratical purposes.

Discussions