当前位置:网站首页>解决Intel12代酷睿CPU单线程调度问题(二)
解决Intel12代酷睿CPU单线程调度问题(二)
2022-07-06 09:29:00 【若苗瞬】
(一)前情回顾
1.1 十二代酷睿大小核和电源模式
参考《解决Intel12代酷睿CPU【小核载满,大核围观】的问题(WIN11)》。
主要问题是即便在Win11下,多线程程序会几乎都运行在小核上,大核空闲,导致效率很低。
解决办法是【电源模式】->【最佳性能】。
1.2 单线程程序问题
参考《解决Intel12代酷睿CPU单线程只给小核运行的问题》。
主要问题是即便设置了最佳性能,自己开发的早期单线程程序,还是会运行在小核上。
当时偶然发现挂一个监控程序,可以尽量的使用到大核。虽然不太理解也是这么做的。
(二)设置优先级(priority)
在上面问题的讨论中,有同学提到可以测试一下设置进程优先级,以及进程相关性。
如下图所示,这两项我们可以在【任务管理器】中,进程【详细信息】页右键菜单中进行设置。
经过测试,优先级挺有效,不再需要挂监控。
将进程优先级设置为【高】以后,测试了之前的一个耗时较长的单线程程序。
竟然比关闭小核还快100秒,如下图。
| 程序 | 8P + 0E | 8P8E性能 | 8P8E挂监控 | 8P8E高优先级 | 单位 |
|---|---|---|---|---|---|
| 另一个单线程 | 1059 | 1367 | 1050 | 940 | 秒 |
而且设置优先级,是可以在自己程序中进行的。
通过CreateProcess()加入HIGH_PRIORITY_CLASS参数控制创建进程的优先级。
也可以SetThreadPriority()在创建后设置优先级。
(三)设置相关性(affinity)
上面菜单中,优先级的下面一项就是相关性。
意思就是设置这个进程用哪些CPU逻辑处理器。
默认是都用,全选的。
测试中发现将最后8个小核心取消勾选后,确实也只会用大核了。
但问题是这个相关性设置,程序代码似乎无法实现。
稍微查了一下,除了上面鼠标点,似乎只可以通过下面的方式设置相关性:
- 通过批处理命令启动程序。
- 通过快捷方式启动程序。
- 通过第三方软件比如
Process Lasso设置。
前面两种的命令格式:start /affinity 0x? app.exe0x? 是按位设置用哪些逻辑CPU。app.exe 就是你想启动的程序。
(四)解决
我这里旧的单线程又很耗时的程序很少。
所以只需要在调度平台中,对这些程序【设置高优先级】就解决了效率问题。
至于【设置相关性】,怎么设置和不同CPU核心数量有关,又没有API可以调用,所以暂时先不考虑。
边栏推荐
- Specify the format time, and fill in zero before the month and days
- Is the sanic asynchronous framework really so strong? Find truth in practice
- C language is the watershed between low-level and high-level
- 969. Pancake sorting
- Programmers, what are your skills in code writing?
- (POJ - 2739) sum of constructive prime numbers (ruler or two points)
- Effet d'utilisation, déclenché lorsque les composants de la fonction sont montés et déchargés
- Browser print margin, default / borderless, full 1 page A4
- useEffect,函数组件挂载和卸载时触发
- Basic Q & A of introductory C language
猜你喜欢

分享一个在树莓派运行dash应用的实例。

Codeforces Round #802(Div. 2)A~D

Raspberry pie 4b64 bit system installation miniconda (it took a few days to finally solve it)

1529. Minimum number of suffix flips

1855. Maximum distance of subscript alignment

Remove the border when input is focused

SF smart logistics Campus Technology Challenge (no T4)

QT simulates mouse events and realizes clicking, double clicking, moving and dragging

Write web games in C language

Codeforces Round #801 (Div. 2)A~C
随机推荐
Suffix expression (greed + thinking)
409. Longest palindrome
The "sneaky" new asteroid will pass the earth safely this week: how to watch it
Summary of FTP function implemented by qnetworkaccessmanager
Acwing: Game 58 of the week
1855. Maximum distance of subscript alignment
875. Leetcode, a banana lover
Flag framework configures loguru logstore
MariaDB的安装与配置
Problem - 922D、Robot Vacuum Cleaner - Codeforces
Vs2019 initial use
1323. Maximum number of 6 and 9
QT实现圆角窗口
Quick to typescript Guide
Hbuilder X格式化快捷键设置
QT按钮点击切换QLineEdit焦点(含代码)
(lightoj - 1323) billiard balls (thinking)
Advancedinstaller安装包自定义操作打开文件
Maximum product (greedy)
C basic grammar