Is a DLL slower than a static link?

前端 未结 4 955
不思量自难忘°
不思量自难忘° 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:49

    If you call DLL-functions they cannot be inlined for a caller. You should think a little about your DLL-boundaries.

    May be it is better for your application to have a small bootstrap exe which just executes a main loop in your DLL. This way you can avoid much overhead for function calls.

提交回复
热议问题