somersettr Offline Upload & Sell: Off
|
| p.1 #1 · p.1 #1 · How to speed up applications running on Intel 12/13 series & Windows 10 | |
I recently upgraded the graphics card in my Windows 10 PC to an RTX 4090 and was slightly disappointed by how much it speeded up some of my applications. In particular, DXO PureRaw 3. Prior to the upgrade, 50MB Sony A1 raw files were taking about 40 seconds each to process. With the 4090 (from GTX 1070), this reduced to 18 seconds. Good but no cigar!
Later, I was using MSI Afterbruner to tweak some settings and its Monitor function showed me how each CPU core/thread was being utilised. When I used this while running PureRaw 3 I found that it always seemed to be using what it calls CPUs 17 to 24. A quick bit of digging showed these to be the Efficiency cores on my I9 12900K processor which suggested a switch to Performance cores might give an improvement.
****************
A quick aside at this point about Intel 12 and 13 series processor. These CPUs contain two different types of processor cores; Performance cores capable of running two thread each and single-threaded Efficiency cores. The Efficiency cores run slower but use much less power than the Performance cores.
My 12900K processor has 8 Performance cores with two threads each and 8 Efficiency cores, so 8 x 2 + 8 = 24 threads in total. These are numbered by monitoring applications as either CPU 1 to 24 or 0 to 23 and it appears that the Performance cores come first followed by the Efficincy cores in this numbering scheme. So 1 - 16 (or 0 to 15) are the Performance cores and 17 - 24 (or 16 to 23) are the Efficiency cores.
WIndows 11 is supposed to be good at deciding whether to assign processes to Performance or Efficiency cores as needed but Windows 10 less so.
****************
The MSI Afterburner monitor showed that PureRaw 3 was using 8 threads simultaneously with CPUs 17 - 24. It is possible in Windows to specify which "CPUs" a process uses:
Go to Task Manager, choose Details tab, find your process, right click and choose Set affinity.
I started my PureRaw 3 program and then used Task Manager to set the affinity to the first 16 CPUs. This basically entails unticking processors 16 through 23. This increased the processing speed dramatically reducing the time from the prior 18 seconds per raw file down to 12 seconds. Considering I was at 40 seconds with the previous graphics card, this seemed a worthwhile speedup.
However, the affinity setting only applies to this instance of the program so when you shut the program down and restart it, the affinity setting goes back to all CPUs.
Setting the Affinity each time a program runs
There are a few ways to make sure that the Affinity setting is as you want it every time a program runs. I chose to do it by editing the Toolbar shortcut that I use to launch the program.
Edit the shortcut by right-clicking and selecting Properties. (If it's a Toolbar shortcut, right-click it then right-click the application name again! before selecting Properties).
In the Properties window, Shortcut tab, I changed the Target field from
"C:Program FilesDxODxO PureRAW 3PureRawv3.exe"
to
%ComSpec% /c Start /Affinity ffff PureRawv3.exe
The bit at the beginning runs the command line processor and the Affinity flag specifies which cores to use. Google it for the full details but basically the Affinity value is a hexadecimal value representing one bit for each thread or "CPU". FFFF sets the first 16 bits to 1 which means use any or all of CPUs 1 to 16 (or 0 - 15 as it appears in Task Manager). If you wanted to force a process only to use CPUs 17 - 24 you would use a value of FF0000. Hope that makes sense!
This technique should be useful for any program which is at risk of Windows 10 assigning it to Efficieny cores. I don't know why or how it does that or if Windows 11 ever makes the same mistake. Let me know if you find this useful or if there are suggestions for improvements/simplifications.
|