Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to maximize power used by my application in C#?

As I've created the application that is hard on calculations -> lots of work to do, not very complex calculations -> it takes too long to work it out and the process is only at 45% of the CPU. Can I maximize it somehow?: to go to 90%?

like image 964
Skuta Avatar asked Jan 22 '26 13:01

Skuta


1 Answers

If you have a dual core machine (which I'm guessing you do), the most you could hope to get in a single thread would be 50% CPU usage.

To get 90% CPU usage, you will most likely need to thread your calculations. This may be very simple, or very difficult, depending on the nature of the algorithm you want to thread.

If you can break up your working set into multiple groups, I would recommend considering using the ThreadPool, or potentially even the Task Parallel Library, depending on your timing for release.

like image 140
Reed Copsey Avatar answered Jan 24 '26 10:01

Reed Copsey