What would cause Windows to report 'High Power' use?

Im confused by a Windows benchmark.
One customer reports that my app runs very slowly on a gaming machine that SHOULD be blisteringly fast.
(3.7Ghz, 16Gb memory, Radeon card etc etc)

Much slower than my 7 year old, 4gb Dell laptop for example.

yet processor and Ram usage don’t look silly.
This is my app on the top row, Chrome underneath.

What would cause ‘very high’ power use?

High Power Usage only means that a process uses a lot of CPU power.

A CPU core on high utilization = high clock frequency (possibly turbo clock) needs a lot of energy.

Please do not be confused by the 6.4% Cpu load. Xojo uses only one thread (if no workers are used, and that would be extra processes). I.e. with an 8 core CPU (Under Windows with HT then 16 available cores) would be 6.25% full load for a core. (Of course assuming it is an 8 core CPU). 100% / 16 Cores.

So your app is running with 100% CPU (if it is a 8 Core cpu)

For a further diagnosis you would need more data and background information about the system and your program. Bottleneck can also be e.g. the disk access. Here is in the Windows performance <monitor possibly more to see.

First of all I would check if a virus scanner is the cause or the brake. This is currently a common problem which leads to such effects.

Translated with www.DeepL.com/Translator (free version)

1 Like

Andreas is right, 6.25% is likely 100% of a single CPU thread.

On macOS you could use the Sample Process command from Activity monitor and see exactly what’s using CPU (or the even better Instruments.app).

Is there a similar way to get a performance / sample stack trace on Windows?

Windows Performance Monitor is the tool ;-). But first of all I would disable (for testing) all Virus Scanners and Malware Checkers. (7 out of 10 support tickets last weeks where because of virus scanners going crazy).


Does WPM actually provide symbolicated stack traces with timing info? Perhaps it does, but I’m not seeing any examples demonstrating it.

A tight loop would certainly do what is described.

Xojo doesnt have any other kind.

1 Like


For i As integer = 0 To 0
// i'm not that tight 
Next i

What’s the second tab showing you in the task manager? any of the cpu’s at 100% ?
I think this happens if you choke the main thread too much, try to lower the priority of threads to 4 on windows (or lower).

You mean right click and set to a lower priority?
Wouldnt that just slow my app down further, though?

No the Thread.Priority you have too much thread time slice being used, too less time for the main thread i think.

On Windows if you have a thread with Thread.Priority = 5 (same as main thread) you may choke windows. Just try to lower it a little.

What does the app do?

1 Like

Is this a setting I can amend in Xojo?

Only on threads you create in code. If you don’t have threads you may have loop method(s) that have
#Pragma BackgroundTasks False ?

If you can’t reproduce the issue perhaps others can. Is this an app the public can download?

It is, but this issue only seems to affect 1 in a 100 or less.
Commonly high end machines.
Other symptoms I have established include failure to write to simple log files in documents or application support.
To me, this is a clear case of virus checker interference, but the (current) customer swears that only Windows defender is in play and turning it off makes no difference.

I thought that the intense part of the app was already in a thread, but checking my code I see I pulled back from that at some point, and it is all still on the main thread. I dont use #pragmas at the moment

If indeed your app has a tight loop that takes too much CPU, you may want to move it to a thread.

Yeah, that sucks. I feel for you. I have an app which works great 99% of the time, but those 1%…

Send me a PM and I’d be happy to test against a few machines if you’d like.

For threads, you can always put in a sleep(10) to sleep 10 ms after each run and that will reduce the CPU load.

sleep(10) after each run?
Wouldn’t that pause the app again, making the use of a thread a bit redundant?