Is a DLL slower than a static link?

前端 未结 4 1025
不思量自难忘°
不思量自难忘° 2021-02-19 14:02

I made a GUI library for games. My test demo runs at 60 fps. When I run this demo with the static version of my library it takes 2-3% cpu in taskmanager. When I use the DLL vers

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-19 14:39

    You will have the overhead of loading the DLL (should be just once at the beginning). It isn't statically linked in with direct calls, so I would expect a small amount of overhead but not much.

    However, some DLLs will have much higher overheads. I'm thinking of COM objects although there may be other examples. COM adds a lot of overhead on function calls between objects.

提交回复
热议问题