I understand that there are quite a lot of messages on this topic, but it is difficult for me to find the answer to this exact question.
For function calls that are faster, a clean virtual interface or pimpl?
At first glance it seems to me that a purely virtual interface will be faster, because using pimpl will cost two function calls instead of one ... or in this case some kind of smart compiler trick will be taken
edit: I am trying to decide which one I should use to abstract the system-dependent parts of several objects, which can end up occurring quite often and in large numbers.
edit
I suppose it’s worth saying that the root of my problem was that I adopted the Abstract Factory design template for a way to make my code work on several platforms when it is really designed to switch implementations for this interface at runtime.
source
share