Handmade Hero»Forums»Code
2 posts
LoadLibrary very slow
Edited by Gentle on Reason: Initial post
Dear HMH community,

first of all I want to say that I really love this project and I would like to thank the people that made all this happen.

But now to my question.

On day 22 we learned how to automatically reload the game code .dll after a re-compile. In the video the reload seems to happen instantly, without a delay.

On my system (Windows 10, VS 2017) it takes ages (up to 5 seconds) to load the dll and I don't why. I removed almost everything from the code to make it as simple as possible, with no success. But not only the on-the-fly loading of the .dll takes so long. When I restart win32_handmade.exe it takes very long to load, and after it was loaded once it loads immediately until it is changed (re-compiled) again. It looks like the dll is cached from the moment it was loaded the first time until it is changed again.

These loading times make the live coding feature useless and it is driving me nuts that I can't figure out, what the reason for that is.

I debugged it and could see that the LoadLibraryA call is the blocking one.

I searched google and this forum about LoadLibrary being very slow, but could not find anything that points me to a solution. I hope to get some help here.

Cheers
Gentle

Mārtiņš Možeiko
2562 posts / 2 projects
LoadLibrary very slow
Maybe antivirus/antimalware software? If you use any, try stopping them temporarily to see if they affect this.
2 posts
LoadLibrary very slow
Thank you so much, that was it (Avira). I always knew that antivirus software is harmful ;-)