Jump to content
Jud

Can't get but 40% CPU usage multi-tasking

Recommended Posts

I write some programs in Delphi that make heavy use of the CPU for a long time.  I used to use Windows 7, 8, and 10 on Sandy Bridge, Ivy Bridge, and Haswell i7 CPUs, with four hyperthreaded cores.  For multitasking, I could get 98% CPU usage.

 

Now I'm using Windows 11 on 12th-14th generation i7s, with eight hyperthreaded P-cores.  But I cannot get more than about 40% CPU usage with 16 threads running.  I look at Task Manager and Process Monitor, and see the under-utilization of the CPU. I have the power setting set for high performance.

 

What caused this loss in performance - Windows or the new CPUs?  And is there a way to utilize most of the CPU?  

 

Share this post


Link to post

Is it a laptop? Maybe the cores get too hot and so gets throttled...

Share this post


Link to post

First of all, the CPU % in task manager is about all threads (I mean cores with hypert. and not). If you use only some cores (and the decision is made by the ITD) the CPU usage never go to 100%.

 

I can assure you that you can reach the full power of you processor. In my applications I stay form 50% to 90% of CPU usage using all possible Corse, but I use in my apps more then 30 TThreads.

Share this post


Link to post
1 hour ago, Olli73 said:

Maybe the cores get too hot and so gets throttled...

Throttling makes the CPU run slower, not run less.

 

2 hours ago, Jud said:

What caused this loss in performance

You can't measure performance by looking at the task manager. Measure the amount of work being done instead.

  • Like 2

Share this post


Link to post
8 minutes ago, Anders Melander said:

Throttling makes the CPU run slower, not run less.

 

OK, but Copilot tells me:
 

Quote

Yes, when a CPU overheats, individual cores may temporarily shut down to prevent damage. Modern CPUs have thermal protection mechanisms in place to take action when specific temperature thresholds are exceeded. This can include shutting down individual cores or even completely shutting down the system to protect the hardware.

 

Share this post


Link to post
2 hours ago, Jud said:

What caused this loss in performance - Windows or the new CPUs?  And is there a way to utilize most of the CPU? 

Like @Anders Melander said, the Task Manager is not the right instrument to measure the performance of your application.

 

One of the simple way is to measure the time the your software needs to do some tasks. Compare with old systems (if you can) or analyze with the datas that you histrical have.

If you really use a bunch of threads you are not able to "consume" all processor power.

 

You can measure performance datas with "profilers" or simply usingn "time base view" with TStopWatch (from System.Diagnostics) for primitive analyses.

Share this post


Link to post
14 minutes ago, Olli73 said:

OK, but Copilot tells me:
 

...

You are really confident about CoPilot or others AI ?

 

Try to reflect about the situation:

 

1) I use 10 COREs at 50%, and the CPU go to 95 degrees:  the system power down one (or more) core  ???? WHYYYYY ????  :classic_blink:

 

The logics about the "deep sleep" of the core is about energy saving, not protections, so if the cores are not used they are "sleeped".

For the protections the Throttle and other factors (like cores voltage and others) are in "game".

 

That is what I know, and I'm ready to change my mind if an HUMAN give me usefull informations, not an AI.

Really, don't take the AI like a GOD.

 

Look here (I try by myself an example from this forum):

Quote

>>> is the number 16777619 a prime number?
No, the number 16777619 is not a prime number.
As I said before, it can be divided by 11 and 1521119, so it does not satisfy the definition of a prime number (i.e. being divisible only by 1 and itself).

 

>>> can you recalculate?
I apologize for the previous error. I recalculated the factor and...
Yes, the number 16777619 is a prime number.
In fact, I did not find any other factor other than 1 and itself. Therefore, it meets the definition of a prime number!

 

Share this post


Link to post
8 minutes ago, DelphiUdIT said:

You are really confident about CoPilot or others AI ?

 

I am aware of issues with AI, Too often AI has invented Delphi functions which would be practical but are not available.

 

I wanted only mention what AI has to say about this...

Share this post


Link to post

Reduced performance with multiple threads may have many reasons, suce as race conditions, lock contentions, cache depletion, etc.
 

Share this post


Link to post
4 minutes ago, Lars Fosdal said:

Reduced performance with multiple threads may have many reasons, suce as race conditions, lock contentions, cache depletion, etc.
 

You are right, and more others like not optimize code .....

 

But I think he's just looking at appearances.
If before he used old generation CPUs, now the new ones (hybrid) are abyss away in terms of real processing power.
One of my applications on an "I7 9700 DDR4" used 75% of CPU and the times "measured" were near 190 ms (no Throttle).
The exact same one on an "I7 12700 DDR4" system uses 45% of CPU and the times are near 110 ms.

So there is a performance drop ... well I would say no.

Share this post


Link to post
5 hours ago, Jud said:

I have the power setting set for high performance.

I forgot about this: in my personal experience, the best settings for applications (not games) is "balanced".

This is based on experience in industrial systems (and in my daily work) where temperature, woking load and peformance should be mixed and should provide consistent performance.

 

With "high performance settings", in the past and I never tried again, I had many issues with variable performance (most of them due to Throttle and temperature).

 

If you force "high performance", the system cannot modulate the use of the resources. Most of the time I had "peaks of lock with downgrade timing" or high temperature recording, with my daily working PC too.

 

Of course, this is my experience, and I'm sure that someone's experience is different.

 

  • Like 1

Share this post


Link to post
8 hours ago, Olli73 said:

but Copilot

I'm seeing this more and more lately. It is very worrisome that people actually think these autocomplete engines are authoritative and will actually argue with you if you present facts that disagree with the text generated by these tools. They may have their uses, but this is borderline scary.

  • Like 1

Share this post


Link to post
15 hours ago, Olli73 said:

Is it a laptop? Maybe the cores get too hot and so gets throttled...

No, it is a desktop.

Share this post


Link to post
14 hours ago, DelphiUdIT said:

First of all, the CPU % in task manager is about all threads (I mean cores with hypert. and not). If you use only some cores (and the decision is made by the ITD) the CPU usage never go to 100%.

 

I can assure you that you can reach the full power of you processor. In my applications I stay form 50% to 90% of CPU usage using all possible Corse, but I use in my apps more then 30 TThreads.

 

Share this post


Link to post

I was allowing it to use all cores.  But it doesn't seem to be putting my program on E-cores  To be sure, I set the affinity to use only P-cores.  Neither way gives the performance I expected.

Share this post


Link to post
14 hours ago, Anders Melander said:

Throttling makes the CPU run slower, not run less.

 

You can't measure performance by looking at the task manager. Measure the amount of work being done instead.

Well, I used to be able to get to 100% usage, now I can't get 50%.

Share this post


Link to post
14 hours ago, DelphiUdIT said:

> One of the simple way is to measure the time the your software needs to do some tasks. Compare with old systems (if you can) or analyze with the datas that you histrical have.

 

Good idea - I do still have an Ivy Bridge i7 with Windows 10 that I can compare to (although it only has 4 cores).

 

> If you really use a bunch of threads you are not able to "consume" all processor power.

 

I used to be able to use 98% +.

 

> You can measure performance datas with "profilers" or simply usingn "time base view" with TStopWatch (from System.Diagnostics) for primitive analyses.

 

I do that, but the CPUs are more than 50% idle.

 

Share this post


Link to post
12 hours ago, DelphiUdIT said:

> I forgot about this: in my personal experience, the best settings for applications (not games) is "balanced". ...

 

Thanks for that.  I just assumed that the "high performance" power setting would be best to get the most out of the CPU.

 

Share this post


Link to post
10 minutes ago, Jud said:

Well, I used to be able to get to 100% usage, now I can't get 50%

My old car consumed 7 liters of diesel per 100 km. The new one only uses 3.5 liters of diesel per 100 km. There must be something wrong with the engine...

 

If your whole system was 100% CPU bound, and able to utilize all cores without any contention, then there would be something to talk about - but it isn't. There's also RAM, disk, bus and controller performance to take into account.

As we have tried to explain, you need to look at the amount of work being done and not the CPU %.

 

You can use the system performance monitor if you really want to find out what your system is doing and what, if anything, is preventing it from running at 100% CPU. But you will have to read up on a lot system internals in order to know what to look at and how to interpret the data.

 

20 minutes ago, Jud said:

I used to be able to use 98% +.

Doing what exactly?

Share this post


Link to post
19 minutes ago, Jud said:

I just assumed that the "high performance" power setting would be best to get the most out of the CPU.

It is. Just make sure throttling is disabled in the BIOS so the CPU runs at full speed all the time. Otherwise it will try conserve energy by throttling the CPU when it thinks you don't need performance.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×