Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Hardware: Lenovo T420s with i7 processor and 8GB RAM, 64bit

How can I configure my computer to maximize / optimize resource allocation to a specific program?

I would like to make Dragon Naturally Speaking operate as quickly as possible, but also be able to do the same for, e.g. R, ArcGIS, or MySQL.

share|improve this question

closed as too localized by Diogo, Shiki, Simon Sheehan, Tom Wijsman, Nifle Mar 13 '12 at 11:41

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Why would you think it wouldn't be doing this already? If there was a "go faster" button, it would come in the on position. –  David Schwartz Mar 12 '12 at 23:05
    
@David why would I make this assumption? There are plenty of reasons that a process might not run at maximum, and when I look at the system monitor, the proces runs with CPU = 25% –  Abe Mar 12 '12 at 23:22
    
@Abe: That's probably because you have a quad-core system (or dual-core with HT) and the program is only loading a single thread. –  David Schwartz Mar 12 '12 at 23:37
    
@Synetech: Why would you suspect that? Even programs you don't care about will still run to completion (assuming they have a fixed amount of work to do), so they'll still need at least the same amount of CPU no matter how you tweak things. But forcing the system to play favorites makes it less efficient. –  David Schwartz Mar 12 '12 at 23:38
    
There is a go faster button. In Task Manager, crank up the process's priority (right click process > priority). –  SecurityMatt Mar 12 '12 at 23:39

2 Answers 2

up vote 2 down vote accepted
  • You can do it manually:
    1. Open the Task Manager (Ctrl+Shift+Escape)
    2. Right-click the program in the Applications tab and select Go To Process
    3. Right-click the process in the Processes, select Set Priority, and choose “Above Normal” or “High” (don’t choose “Realtime” unless you really know what you’re doing!)
    4. Right-click the process again and select Set Affinity and make sure that all of the CPU check-boxes are checked (this is the default)

  • If you want to do it automatically, you can create a script:
    1. Create a text-file called for example mysql.bat:
      start /high "MySQL" "c:\mysql\mysqld.exe --options --blah"
    2. Then create a shortcut to it, making sure to set the Run field in the Shortcut tab to “Minimized”.
share|improve this answer
1  
Note that this can have the reverse of the expected effect. This will give other tasks smaller timeslices resulting in them running less efficiently and needing more CPU time than they would otherwise. It's also bad on multi-core CPUs because lower cache efficiency from other tasks (due to smaller slices) means slower memory accesses for the tasks you care about. You're better off letting the scheduler run all tasks efficiently than boosting some at the expense of others. If another task needs the CPU for a bit, it's better to get its job done quickly and efficiently. –  David Schwartz Mar 12 '12 at 23:11
    
@David, if you read the whole question (as opposed to just the title), you will see that he is asking about prioritizing a couple of specific programs. –  Synetech Mar 12 '12 at 23:31
    
Yes, I understand that. The problem is, this will make other programs run less efficiently, resulting in them needing more CPU than they would otherwise. This will actually make the preferred program run worse for two reasons: The other programs will need to run more of the time and will probably actually run more of the time. Memory accesses will be slower because other programs will need to refill caches more often. Both of these factors cause the program with priority to run slower. –  David Schwartz Mar 12 '12 at 23:36
    
But that’s not what he asked, he asked how to prioritize a program. This is not the place to lecture them about preemptive multitasking. If you were correct in your assertions, then the ability to change priorities for processes would not exist, and yet, it does. Why do you think that many programs have a built-in function to set priorities? Some programs let you choose to run it in high-priority so that background programs do not slow it down, while others let you choose to run it in low-priority to avoid bogging down other programs. –  Synetech Mar 12 '12 at 23:44
1  
He asked how to maximize the allocation of the CPU to a specific program. Raising the priority is how that is done. I don’t see your confusion. I have answered the question that was presented. If you think the problem is something else, then flag the question to be closed and tell Abe open a new one asking “why the CPU does not run at 100%”. –  Synetech Mar 13 '12 at 0:18

This is likely not possible to do and attempts to do so will be counter-productive. Trying to force the system to play favorites makes it less efficient. The other programs will still need at least the same amount of CPU as they need now, so the same amount will be left over for the preferred programs. You might improve latency for the preferred program a little bit, but at the cost of more cache refills from the other programs slowing it down while it's running.

Basically, the people who designed your OS and its scheduler knew what they were doing. Unless you know something significant that they don't about your specific use, you're much more likely to make things worse than better.

When you see a program is only using 50% or 25% of the CPU or an even number like that, it's almost always because it's fully loading as many cores as it is capable of using. Getting the program to use more cores generally requires re-designing it.

Some specific programs may be tunable for multi-core. If the program is one of these, and that switch is off, turning it on can definitely help. But most such programs automatically detect multi-core machines. So there's no room for improvement there usually.

You can also cause performance catastrophes this way. Just ask the Mars rover team. For example, imagine if the process you've boosted has two threads and the system has one core. The first thread is blocked on a system resource currently held by another process. The second thread can make lots of forward progress. The first thread can be stalled for a very long time because the second thread can starve the other process such that it can't release the system resource.

This can happen even if the developer of the program specifically lowered the priority of the second thread to try to give CPU preference to the first thread because it was doing important work. The static process priority controls Windows gives you are just too coarse. This will, for example, happen on many file accesses if you have an active anti-virus scanner.

share|improve this answer
    
but the is designers knew enough to provide the ability to manually set priorities, and my colleagues and I do this frequently on our shared server using torque. There are times when I just want my computer to crank through something while I am using another machine –  Abe Mar 13 '12 at 4:48
    
@Abe: They provided the ability both for legacy reasons, to support cases where latency is more important than throughput, and for cases where the load placed by other tasks is not fixed. If you want your computer to crank through something, just let it crank. (In fact, Microsoft specifically warns against changing process priorities, among other reasons, because of the serious risk of priority inversion caused by contention for system resources.) –  David Schwartz Mar 13 '12 at 5:15
    
Please explain us how the Mars Rover relates to the Windows kernel, because it is using an entirely different scheduler and thus that paragraph does not necessarily hold for the Windows kernel. I do not see Microsoft warn us for that reason, and that Wikipedia link lists solutions which might (or might not) have been implemented in the Windows kernel. –  Tom Wijsman Mar 13 '12 at 10:19
    
@TomWijsman: The point is that changing task priorities can have serious negative affects and that having all your tasks at the same base priority eliminates a lot of possible failure modes. Changing from two things being at the same priority to them being at different priorities is dangerous when they both access a shared resource (in this case, the Windows GUI system) in complex ways. –  David Schwartz Mar 13 '12 at 13:08
    
@DavidSchwartz: The Windows GUI system runs at high priority, only the real-time priority is above that. The programs mentioned by the OP don't really depend on any other shared resources... –  Tom Wijsman Mar 13 '12 at 13:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.