# High CPU Usage when lauching game via Editor

**URL:** <https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654>\
**Category:** Bugs\
**Created:** [July 17, 2023, 10:05am UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654 "2023-07-17T10:05:20Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![ainonovo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ainonovo/32/27068_2.png) [@ainonovo](https://forum.defold.com/u/ainonovo)\
**Post date:** [July 23, 2023, 5:44am UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/22 "2023-07-23T05:44:41Z")

</div>

это здесь не причем. у меня 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%

 ![1](https://forum-defold-uploads.b-cdn.net/original/3X/a/c/ac703edb8d3514dfecd85841851cd0f9f7718566.png)  
 ![2](https://forum-defold-uploads.b-cdn.net/original/3X/1/b/1b91089d1cb20099e0fff84f5f405568c75f35de.png)  
 ![3](https://forum-defold-uploads.b-cdn.net/original/3X/7/4/740e904bdfd8cbab38190dae6fdfe23fb60f62f6.png)

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

**empty new project**

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [July 23, 2023, 5:57am UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/23 "2023-07-23T05:57:52Z")

</div>

> [@ainonovo](#):
>
> it has nothing to do with it.

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](https://defold.com/manuals/profiling/#the-web-profiler)

> Select Debug ▸ Open Web Profiler menu.

---

<div class="post-metadata">

**Author:** ![ainonovo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ainonovo/32/27068_2.png) [@ainonovo](https://forum.defold.com/u/ainonovo)\
**Post date:** [July 23, 2023, 6:05am UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/24 "2023-07-23T06:05:32Z")

</div>

![2](https://forum-defold-uploads.b-cdn.net/original/3X/f/a/fa396279b9cc2ae52cd65568fd41a52c692aecd0.png)  
 ![1](https://forum-defold-uploads.b-cdn.net/original/3X/2/9/293eb9aee6a392aa5a39d8635f9be48903136fe4.png)

let’s figure it out))

I am ready to provide any information

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [July 23, 2023, 6:08am UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/25 "2023-07-23T06:08:51Z")

</div>

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

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/4/e/4ee3dbdd0b2a9e2cdc865f147e049fa543f8b5ba.png)

---

<div class="post-metadata">

**Author:** ![ainonovo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ainonovo/32/27068_2.png) [@ainonovo](https://forum.defold.com/u/ainonovo)\
**Post date:** [July 23, 2023, 6:15am UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/26 "2023-07-23T06:15:30Z")

</div>

![1](https://forum-defold-uploads.b-cdn.net/original/3X/7/8/78418782d9df19dba3ef361889a2f7a97ba55950.png)  
 ![2](https://forum-defold-uploads.b-cdn.net/original/3X/4/3/4339ec649f9f57f6cc73aa6be7823cba38b4b722.png)  
 ![3](https://forum-defold-uploads.b-cdn.net/original/3X/9/0/902adac6a2c142b1e0d739225eea64276ae0942a.png)  
 ![4](https://forum-defold-uploads.b-cdn.net/original/3X/f/1/f1a0b2367f3423e293aef42234b05af15445390a.png)

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [July 23, 2023, 6:32am UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/27 "2023-07-23T06:32:53Z")

</div>

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

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/f/a/fac91f8c90858f4e91d0e8d8e85f301f66f88d80.jpeg)  
then run it and take a look how much CPU it takes in Windows Task Manager?

---

<div class="post-metadata">

**Author:** ![ainonovo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ainonovo/32/27068_2.png) [@ainonovo](https://forum.defold.com/u/ainonovo)\
**Post date:** [July 23, 2023, 8:33am UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/28 "2023-07-23T08:33:48Z")

</div>

![1](https://forum-defold-uploads.b-cdn.net/original/3X/8/4/8454925714ea568c08016e82ee5dd7c66126751b.png)  
 ![2](https://forum-defold-uploads.b-cdn.net/original/3X/2/c/2c0dae3409b8bf773d7bafc70bce3ffe2c30f8be.png)

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

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [July 23, 2023, 11:14am UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/29 "2023-07-23T11:14:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ainonovo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ainonovo/32/27068_2.png) [@ainonovo](https://forum.defold.com/u/ainonovo)\
**Post date:** [July 23, 2023, 11:47am UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/30 "2023-07-23T11:47:37Z")

</div>

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 🤣

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

---

<div class="post-metadata">

**Author:** ![Mega-Ninjax](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mega-ninjax/32/32199_2.png) [@Mega-Ninjax](https://forum.defold.com/u/Mega-Ninjax)\
**Post date:** [July 23, 2023, 12:04pm UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/31 "2023-07-23T12:04:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mega-Ninjax](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mega-ninjax/32/32199_2.png) [@Mega-Ninjax](https://forum.defold.com/u/Mega-Ninjax)\
**Post date:** [July 23, 2023, 12:05pm UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/32 "2023-07-23T12:05:20Z")

</div>

Does that mean Defold is your first game engine ?

---

<div class="post-metadata">

**Author:** ![ainonovo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ainonovo/32/27068_2.png) [@ainonovo](https://forum.defold.com/u/ainonovo)\
**Post date:** [July 23, 2023, 12:13pm UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/33 "2023-07-23T12:13:06Z")

</div>

yes

---

<div class="post-metadata">

**Author:** ![Mega-Ninjax](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mega-ninjax/32/32199_2.png) [@Mega-Ninjax](https://forum.defold.com/u/Mega-Ninjax)\
**Post date:** [July 23, 2023, 12:34pm UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/34 "2023-07-23T12:34:45Z")

</div>

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.

 ![Gdot](https://forum-defold-uploads.b-cdn.net/original/3X/4/4/44738f2337419897b44e7d2f6ac24dc52fe3225a.png)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [July 23, 2023, 1:04pm UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/35 "2023-07-23T13:04:38Z")

</div>

> [@Mathias\_Westerdahl](#):
>
> What happens if tou compare with Unity or Godot or Unreal? ( it would be good to have something to compare to)

Here’s an empty Godot project running on macOS:

 ![Screenshot 2023-07-23 at 14.57.20](https://forum-defold-uploads.b-cdn.net/original/3X/5/5/554bdd91801a10b1c0113574ce6276317435021a.jpeg)

And an empty Defold project:

 ![Screenshot 2023-07-23 at 14.53.33](https://forum-defold-uploads.b-cdn.net/original/3X/3/2/327a9271bafff8bb24797a6161f5659b63c01a15.jpeg)

And an empty Unity project:

 ![Screenshot 2023-07-23 at 15.00.56](https://forum-defold-uploads.b-cdn.net/original/3X/b/b/bb09f5769dfa7bdd7893e0d8b844e37c80b7d244.jpeg)

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.

---

<div class="post-metadata">

**Author:** ![ainonovo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ainonovo/32/27068_2.png) [@ainonovo](https://forum.defold.com/u/ainonovo)\
**Post date:** [July 23, 2023, 3:10pm UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/36 "2023-07-23T15:10:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [July 23, 2023, 3:51pm UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/37 "2023-07-23T15:51:13Z")

</div>

> [@ainonovo](#):
>
> The problem is that the project does nothing, but already loads the processor by 20% or more.

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:

 ![Screenshot 2023-07-23 at 17.47.45](https://forum-defold-uploads.b-cdn.net/original/3X/e/f/ef7ac00ad67438396d7573180da99426905ee75a.jpeg)

> [@ainonovo](#):
>
> In addition, you are constantly adding new functionality that will also eventually affect performance.

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.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [July 23, 2023, 3:59pm UTC](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654/38 "2023-07-23T15:59:03Z")

</div>

> [@ainonovo](#):
>
> 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.

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:

 ![Screenshot 2023-07-23 at 17.54.27](https://forum-defold-uploads.b-cdn.net/original/3X/0/6/066119abc4b89cafc7cc299c445524d7f1dc5bab.jpeg)

 ![Screenshot 2023-07-23 at 17.56.10](https://forum-defold-uploads.b-cdn.net/original/3X/6/5/65cb47cc6ccdfedd8df09bf824189972bae71f14.jpeg)

 ![Screenshot 2023-07-23 at 17.57.56](https://forum-defold-uploads.b-cdn.net/original/3X/9/b/9bd4f84074a27480b77a453da7c13596ed903c80.jpeg)

[Previous page](https://forum.defold.com/t/high-cpu-usage-when-lauching-game-via-editor/73654.md?page=1)
