本帖最后由 阿伯才的风格 于 2012-8-8 21:09 编辑
来远景这么久了,也看了不少帖子,其中不乏“浅谈系统垃圾”“我为什么不优化”之类的好帖,但也少不了各种各样伪优化的帖子。
其中有那么点帖子更是坑爹中的坑爹。简直就是不但坑了自己,还坑了别人,连斑竹跟着一起坑……
好吧言归正传。我对系统优化的态度,也是本着以理论为依据,以证据为准绳的态度,本着……(此处省略废话XXXX字),所以下文中的一些优化“技巧”不仅有操作过程,还有着详实论证。但纵然如此,仍然是经验论,希望高手前来拍砖。
警告:本次涉及到的技巧均涉及到对注册表进行修改,具有一定的危险性。希望广大景友尝试前,做好充足的备份工作以免不测。对技巧的论述,下文将慢慢赘述。
为了某些急性子的朋友,我直接先把方法和内容贴出来,并给予个人的参考意见,这些技巧win7 32 64位通用,但不保证其他系统可用。
1. 修改系统内核分页方式,让响应更为顺畅
方法:找到HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Managerment
将其中DisablePagingExecutive修改为01(默认值00)
效果:00表示系统核心按需分页,01表示常驻内存。如此修改可以使系统内核常驻于内存使系统响应更为顺畅。
个人意见:只要内存足够尽管启用,无论是理论上还是事实上,确实可以加快系统响应。但小内存用户就免了,避免内存不足导致不必要的麻烦,个人推荐阈值是1536MB
2.修改文件系统记录方式,让磁盘访问进一步加快
方法:找到HKLM\SYSTEM\CurrentControlSet\Control\FileSystem
将其中NtfsDisableLastAccessUpdate改为01(默认值00,有朋友告诉我这个值默认是01,那么如果原值就是01的就不要修改了)
------------------------------------------------------------------------
经证实,此选项确实默认值是01而不是00,或许是我上一次系统中这个项被无意之间修改掉了吧……在此订正!
效果:00表示记录最后访问时间,01表示不记录。修改为01后可以避免访问时记录访问时间,减少磁盘IO,降低磁盘压力。但是,可能导致一部分老旧的应用程序无法访问。
个人意见:HDD用户可按需打开这一选项,SSD用户还是不要做修改来的好。
3.修改系统处理器分配计划,加速前(后)台进程
方法:找到HKLM\SYSTEM\CurrentControlSet\Control\PriorityControl
对Win32PrioritySeparation进行修改
默认值02(02),修改为十六进制28(十进制40)表示倾向于前台分配,修改为(十六进制25)(十进制37)表示为 ,前台大幅加强,修改为十六进制26(十进制38)表示前台超大幅加强,修改为十六进制18(十进制24)表示后台进程大幅加强
Ps.个人不会润句,理解意思就好
个人意见:不做服务器的话,一般来说选择28是一个不错的选择。如果机子CPU比较弱,可以选择25。如果机子CPU真的很弱,弱到几乎难以运行的时候,26或许令运行情况得以改观。如果做服务器,18是你的唯一选择。当然,足够高配的机子可以不做修改以取得最佳平衡性。
下面是上面技巧的原理说明
声明:以下解释来自微软知识库(英文版),对其中理解为个人意见,不表示绝对正确,如果错误,希望大家互讨论,增进技术。
1 DisablePagingExecutive
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management
Data type Range Default value
REG_DWORD 0 | 1 0
Description
Specifies whether kernel-mode drivers and kernel-mode system code can be paged to disk when not in use.
Value Meaning
0 Drivers and system code can be paged to disk as needed.
1 Drivers and system code must remain in physical memory.
以上为微软自己对该注册表项的描述,其中值的含义应当是和我理解无偏差,所以根据理论上来说,保留系统核心内存是有利于系统运行的顺畅性的
2. NtfsDisableLastAccessUpdate
HKLM\SYSTEM\CurrentControlSet\Control\FileSystem
Data type Range Default value
REG_DWORD 0 | 1 0
Description
Specifies whether NTFS updates the last-accessed timestamp of a file when that file is opened.
Because updating the last-accessed timestamp requires writing data to the disk, an activity that accesses many files might be faster if this type of update is disabled. However, some applications may require that files have an accurate last-accessed timestamp.
Value Meaning
0 NTFS updates the last-accessed timestamp of a file whenever that file is opened.
1 NTFS does not update the last-access timestamp of a file when that file is opened.
This entry does not exist in the registry by default. You can add it by using the registry editor Regedit.exe.
该设置含义1l已经描述,此处不再赘述。值得注意的是,Description中,“Because updating the last-accessed timestamp requires writing data to the disk, an activity that accesses many files might be faster if this type of update is disabled.”是微软自己对该选项的看法,也就是说,禁止记录最后访问时间的选项在一帖情况下是可以其他加快访问速度的效果的。
3. Win32PrioritySeparation HKLM\SYSTEM\CurrentControlSet\Control\PriorityControl
Data type | Range | Default value | REG_DWORD
| 0x0–0x3F (111111 binary)
| 0x2 (000010 binary)
| Description
Specifies the strategy used for optimizing processor timeon the system. The value of this entry determines, in part, how much processortime the threads of a process receive each time they are scheduled, and howmuch the allotted time can vary. It also affects the relative priority of thethreads of foregroundand background processes .
The value of this entry is a 6-bit bitmask consisting ofthree sets of two bits (AABBCC). Each set of two bits determines a differentcharacteristic of the optimizing strategy.
· The highest two bits (AABBCC)determine whether each processor interval is relatively long or short. · The middle two bits (AABBCC)determine whether the length of the interval varies or is fixed. · The lowest two bits (AABBCC)determine whether the threads of foreground processes get more processor timethan the threads of background processes each time they run. The values of the bits are as follows:
The highest two bits (AABBCC) determine how long thethreads of processes are permitted to run each time they are scheduled. Thisinterval is specified as a range because threads can be preempted and processortime is not precisely determined.
Values of the highest two bits:
Value | Meaning | 01
| Longer intervals
| 10
| Shorter intervals
| The middle two bits (AABBCC) determine whether the lengthof processor time varies or is fixed. It also determines whether the threads offoreground processes have longer processor intervals than those of backgroundprocesses. If the processor interval is fixed, that interval applies equally tothe threads of foreground and background processes. If the processor intervalvaries, the length of time each thread runs varies, but the ratio of processortime of foreground threads to background threads is fixed.
If a variable interval is specified, the ratio offoreground thread processor time to background thread processor time isdetermined by the value of the lowest set of bits.
Values of the middle two bits:
Value | Meaning | 01
| Variable-length intervals
| 10
| Fixed-length intervals
| The lowest two bits (AABBCC) determine the ratio ofprocessor time of foreground to background threads. This value is used onlywhen the middle two bits in this mask specify a variable-length interval.Otherwise, the processor interval for foreground and background threads is thesame.
Values of the lowest two bits:
Value | Meaning | 00
| Equal and fixed. The threads of foreground processes get the same amount of processor time as the threads of background processes and as the threads of processes with a priority class of Idle. Also, the processor interval is fixed. This value overrides the specification of a variable-length interval in the middle two bits.
| 01
| 2:1. The threads of foreground processes get twice the processor time as the threads of background processes each time they are scheduled for the processor.
| 10 or 11
| 3:1. The threads of foreground processes get three times the processor time as the threads of background processes each time they are scheduled for the processor.
|
这个键值由AABBCC 6个位组成的其中AA位表示前/后台,10表示前台,,01表示后台。BB位表示推进(大约是这个意思,也就是第三段的时间分配比例设置是否生效的意思)10表示不生效,01表示生效。第三段CC表示时间分配计划,00表示默认,01表示前:后=2:1,10表示前:后=3:1,综上,前台默认优先是101000即十六进制28(十进制40),前台加强优先(分配为2:1)位100101,也就是十六进制25(十进制37),前台明显加强(3:1)就是100110,也就是十六进制26(十进制38)。这个设置更改的是处理器分配的时间比例,前台多了意味着后台变少,所以并不是前台越高越好,所以我个人倾向于28(40),但是在低配机上,又是CPU会因为性能不够强劲而使当前运行的程序响应变慢,所以可以按需选择加强
|