High CPU Usage when lauching game via Editor

это здесь не причем. у меня 2 ноутбука - примерно с одинаковой производительностью и у обоих сильная загрузка 25-32 % на пустых дефолтных проектах. да и штмл5 версия тоже неслабо грузит процессор. это я ещё с 1.2 заметил - с которой собственно и начал изучение.

вон же пишет выше человек

it has nothing to do with it. I have 2 laptops - with about the same performance and both have a strong load of 25-32% on empty default projects. Yes, and shtml5 version also heavily loads the processor. I noticed this from 1.2 - with which I actually began the study.

there is a person writing above

11900K = 14-16% CPU usage
i5 13th the gen = 10-18 %
i3 550 = 55-65 %
CPU 6405U @ 2.40GHz = 25-32%



пустой новый проект

empty new project

But profiler is the only way to know what’s going on in the engine that takes so much CPU.

Just call profiler.enable_ui(true) in init() and post screenshot here or using web profiler

Select Debug ▸ Open Web Profiler menu.


let’s figure it out))

I am ready to provide any information

Please, reset game.project->Display settings to defaults and do it again.
image




and one more thing. Could you please make a release bundle


then run it and take a look how much CPU it takes in Windows Task Manager?


there has always been a load. I don’t know if this is normal or not

1 Like

What happens if tou compare with Unity or Godot or Unreal? ( it would be good to have something to compare to)

i dont use any software, but i know windows hack. just click mouse somewhere on windows desktop and press CTRL+A

after, press Enter on keyboard :rofl:

One day in 2021, I just decided to make my own online game. I googled - I liked the defold multi-platform support. That’s all what I know

I have used Godot 3-4 as my First Game Engine so i can tell what i experienced.

When you launch a game ( Via Editor ) the CPU usage depends on the task you doing in the game.

I will post the Images here when am at work table.

And I don’t use Unity and Unreal.

Does that mean Defold is your first game engine ?

yes

Here is the Screen Shot of one of examples I found on Git Hub for Godot.

I use 32 bit version but results are same on 64 bit as well.

Here’s an empty Godot project running on macOS:

And an empty Defold project:

And an empty Unity project:

So in my test Defold and Godot use more or less the same amount of CPU. Unity on the other hand is not. I’m not sure what the update loops looks like in Godot and Unity respectively, but it seems like Unity is taking a different approach when idle.

1 Like

The problem is that the project does nothing, but already loads the processor by 20% or more.

The problem is that when the animation and sounds begin to play, network interaction and various calculations begin - then there will be low fps and high cpu utilization.

This will limit the range of devices used. In addition, you are constantly adding new functionality that will also eventually affect performance.

It’s my personal opinion. You can ignore him.

Not entirely sure it is a problem unless nothing scales to 100% CPU by doing something. Here I animate 25000 sprites and I’m not even reaching 40% CPU:

Yes and no. We do add functionality but also pay attention to performance. A lot of features we add will only impact performance if used. And sometimes we add functionality that will also improve performance.

4 Likes

It’s not like that. Let me try to explain it in a super simplified way.

Game engine loop is not like : run the loop 60 times and does nothing else.

It is a while(true) loop that does as many operations as possible.
Most of the time, this while(true) runs doing almost nothing (it calculates delta time and some other lightweight operations). But it is still an infinite loop that works as much as OS let to (in your case, for 30% CPU).

So, just for example, let’s say you run this almost empty loop 100.000 times a second, which takes 30% CPU on your PC.
Then you add some functionality. And now your loop have to do something. You can’t run it 100.000 times anymore, you run it, let’s say, 5.000 times where 60 times the engine does something which uses CPU time as well (logic, physics, networks and so on). So you have more or less the same 30% CPU usage, but this time you utilize this CPU usage with useful work instead of almost empty superfast loop.
Of course if you add a lot of functionality, CPU usage will grow even more than these 30%, but till some bar it will not be just adding to 30% CPU usage, but utilization of these 30%.

To prove my point:

5 Likes