Give more CPU to a process

Joined
Jul 24, 2012
Messages
50
Reaction score
0
Points
6
Your Mac's Specs
iPhone 4s | iPad 2 | 21.5" iMac 2.7GHz 1TB
I have a program which i have created to analyse a dataset, there is a lot of computation involved so its taking a long time to complete.
When it is running, if i look at the activity monitor, my program says its taking up 163.3% under the CPU column. At the bottom it gives a breakdown of System, User and idle %. User is around 34% and Idle is 52%. Is there any way of allocating more CPU time, in the hope it will speed up the computation of my program?

It is running on an iMac 2.7GHz with OSX 10.9.
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,765
Reaction score
2,106
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
If no other program is running, technically your program can use ALL of the CPU time available. If, however, the CPU is idle while your program is running, then your code isn't efficient and has states in which it is waiting for information and thus isn't running.

Look at your program and minimize any waits, loops and ensure all of your accesses are done efficiently. If you need to load data to analyze, if possible, load all of it into memory so that the CPU can spend all of it's time analyzing it as opposed to loading more data..
 
OP
W
Joined
Jul 24, 2012
Messages
50
Reaction score
0
Points
6
Your Mac's Specs
iPhone 4s | iPad 2 | 21.5" iMac 2.7GHz 1TB
hmmm, I'm running a MATLAB script. The data is loaded in at the start and then it is accessed within a loop, the data is accessed thousands of times but it is only loaded once.
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,765
Reaction score
2,106
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
OK, if the loading is done once it may be a matter of how efficiently Matlab is running your script and iterating over the data..

What was the System % when your script was running?
 
OP
W
Joined
Jul 24, 2012
Messages
50
Reaction score
0
Points
6
Your Mac's Specs
iPhone 4s | iPad 2 | 21.5" iMac 2.7GHz 1TB
System was about 13-14%
 
Joined
May 17, 2011
Messages
73
Reaction score
2
Points
8
Your Mac's Specs
MacPro 5,1 - 2 x 3.46GHz, 128GB; MacPro 1,1 - 2 x 3GHz DC, 32GB; PowerMac 7,3 - 2 x 2GHz PPC, 8GB
How much RAM do have and how is it being utilized? Also, is your MATLAB taking advantage of multiple cores?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top