AntiMicroX / antimicrox

Graphical program used to map keyboard buttons and mouse controls to a gamepad. Useful for playing games with no gamepad support.
GNU General Public License v3.0
2.43k stars 140 forks source link

CPU USAGE background service #825

Closed Derillo closed 1 year ago

Derillo commented 1 year ago

Is there an existing issue for this?

Current Behavior

Hello 👋 In this attached image describes 5 processes that are constantly running in the background and I can't pinpoint the reason. Antimicro running in the background performs some process that is constantly running. Cases like Macro Button (VB-AUDIO) does not consume anything in the background and does the same job. imagen

Expected Behavior

Is it a performance problem? Can anyone identify why this is happening? Is it possible to correct it under so many windows library dependencies? It's just a few questions

Steps To Reproduce

  1. Open Antimicro
  2. Task Manager or Process Explorer (for wwww.sysinternals.com)
  3. Search this process AntimicroX.exe
  4. See column CPU
  5. Variation CPU use

imagen

Environment

Versión del programa 3.3.4
Compilado desde el empaquetado: GitHub Windows Release
Construído contra SDL 2.26.5
Ejecutándose con SDL 2.26.5
Usando Qt 5.15.2
Usando gestor de eventos: SendInput
Host OS: windows Version: 10 Architecture: x86_64

Anything else?

No response

pktiuk commented 1 year ago

I don't understand your request.
What's the problem? Why seeing multiple processes is a problem?

Derillo commented 1 year ago

First of all, I use the translator to write this thread. The problem is, why does the background service use cpu without me using it? What is he doing while running in the background? The average constant consumption is 2% of the cpu. Can this be fixed from programming?

pktiuk commented 1 year ago

Every app running in background uses some cpu.
If you don't want it just close the app.

Derillo commented 1 year ago

Hello @pktiuk I hope you are well and thanks for answering.

  1. Do not create this thread with the desire to generate a discussion or any member of the community.

  2. Let me correct you. Your statement is not correct. If each service will use 2% of the cpu (at least 30 running on any system) in idle any computer would use 60% of the cpu. That is not right. Background services don't constantly run threads for nothing. Programmers seek efficiency.

  3. It is true that it might not be an issue to consider improving for this open source software. What I don't think is correct is that you close a disinterested user report and you can't even answer my question.

Question: What piece of software constantly creates these threads? What is their function? Can it be improved?

greetings

pktiuk commented 1 year ago

What piece of software constantly creates these threads?

Are these threads constantly created? How many threads per hour are created?

There are severeal threads used by antimicrox (number of these should not change over time).

As far as I recall there are (there may be some additional threads created by some libraries like SDL):

Every of them has its own purpose.

Background services don't constantly run threads for nothing. Programmers seek efficiency.

I think you can guess now which one is constantly performing actions in the background.

Looking for efficiency is not as straightforward as you may think. There is something called premature optimization. pic source

I don't have time to properly refactor important code, so any optimizations are not in the scope of this project now.