Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any perf hit using DLL functions?

Tags:

c++

linux

g++

As the title says, compared to a normal function, is there a perf hit in calling dll functions? The dll will be loaded by dlopen. EDIT: Ignore dlsym time because I only do it once per each function.

like image 750
nakiya Avatar asked Oct 11 '10 10:10

nakiya


1 Answers

Calls to DLL functions are indirect by address and the compiler can't inline them, so there is a slight performance hit.

You should only worry if you use them in a performance critical inner loop and after profiling them.

like image 88
Axel Gneiting Avatar answered Sep 20 '22 20:09

Axel Gneiting