Profiler Resource, slowing down DMEngine

Hello,
When testing my game using the dmengine, I keep getting those messages:

WARNING:DLIB: Profiler Resource.LoadResource took 2.224 seconds
WARNING:DLIB: Profiler Resource.Get took 2.224 seconds
WARNING:DLIB: Profiler Resource.Get took 3.202 seconds
WARNING:DLIB: Profiler Resource.Get took 3.268 seconds
WARNING:DLIB: Profiler Resource.Get took 3.351 seconds

The result is that screens in my game load slowly.

I don’t call the profiler explicitly in my code,

Am I doing something wrong?

The weird thing is that, sometimes I don’t get these messages, and the collections load very quickly.

Are you using the same engine copy that is running or starting a new engine copy? These lines are the Profiler reporting that Resource.Get etc. took time to do, usually I see that when reusing the same engine copy (which I tend to avoid - closing the engine manually every time I want to reload). I use Windows 10 so behavior might be different on macOS / Linux / might just be so fast you don’t notice it on newer computer builds.

1 Like

You’re right, it happens mostly when I’m running the same engine copy.
If I close it manually beforehands, it goes quicker.
is that normal though?

It does seem to be normal. One is the editor preparing everything before launching vs the engine getting what it needs on a new engine restart, there must be some mechanical differences that matter with it taking longer. Maybe it can be made more efficient / take less time in the future.

Indeed, this behavior is not intentional, and we’d like to revisit it some day to improve on the performance.

2 Likes

The profiler is active in debug builds and it will output things like the messages you see in the console when something in the engine takes a long time. It is not the profiler itself that is slow or causing other things to become slow. The profiler output should be considered as a help to you as a developer that there is something going on that you need to investigate (like you are doing now!)

1 Like