惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
Tenable Blog
Project Zero
Project Zero
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
S
Schneier on Security
Scott Helme
Scott Helme
S
Securelist
Know Your Adversary
Know Your Adversary
Vercel News
Vercel News
IT之家
IT之家
V
V2EX
F
Fortinet All Blogs
Simon Willison's Weblog
Simon Willison's Weblog
K
Kaspersky official blog
博客园_首页
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
Spread Privacy
Spread Privacy
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
有赞技术团队
有赞技术团队
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
L
LINUX DO - 热门话题
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
S
SegmentFault 最新的问题
AWS News Blog
AWS News Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost

博客园 - redfox

apns 服务 新的开始,新的起点 心情笔记 最简便的清空memcache的方法 MYSQL慢查询日志(转) 实现linux和时间服务器的时间同步 Windows 远程桌面不能连接解决办法 常用的adodb使用方法 六个经典的英语面试问题 php curl 下载文件 向访客和爬虫显示不同的内容 我的新博客地址! apache日志分割专题 uptime查看linux负载及数值的意义 linux 下的服务 /etc/xinetd.d ajax 跨域 XAMPP 配置虚拟机 ie下js调试超级爽的工具IE WebDeveloper V2 (附注册码) www.qian14.cn 终于解决了这个问题
二级缓存伪优化揭秘(转)
redfox · 2009-08-30 · via 博客园 - redfox

对于处理器(CPU)二级缓存(L2 Cache)的作用,想必大家都多多少少有一定了解,即使不完全明白其中道理,至少也可以从Pentium 4和Celeron的差价判断出其重要性,256KB二级缓存的Celeron D 2.4GHz比512KB二级缓存的Pentium 4 2.4C便宜近一半。如果这时候有人说Windows XP操作系统并没有充分利用CPU的二级缓存,你会怎么想?这简直就是在浪费用户的投资嘛!

事实上,有一种广为流传的说法是Windows XP没有对CPU进行优化,理由就是它默认状态下并没有打开CPU的二级缓存。如果你打开注册表编辑器,找到“HKEY_LOCAL_MACHINE\SYSTEM\ CurrentControlSet\Control\Session Manager\Memory Management”,在其中可以看到一个名为“SecondLevelDataCache”的项,它的默认值为“0”。再明显不过了,“SecondLevelDataCache”就是二级数据缓存的意思,既然被设置为“0”,那就是关闭了二级缓存。

正是基于以上论断,才出现了优化二级缓存的技巧,也就是把“SecondLevelDataCache”的值设置为CPU的二级缓存容量(单位KB)。在众多的优化软件中也包含了优化CPU二级缓存的设置。

事实上,修改“SecondLevel DataCache”的值没有任何优化作用,这是为什么呢?
我们在微软的知识库中找到了如下的内容:“HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management”中的SecondLevelDataCache键的值只有在Windows XP系统从硬件抽象层(Hardware Abstraction Layer )读取CPU二级缓存(L2)失败时才会读取SecondLevelDataCache键的数据。而且SecondLevelDataCache键值=0的意义是二级缓存为256KB。

在一篇知识库文章中我们还找到了“Do not change the SecondLevelDataCache entry ”这样的话,在文章中指出一些第三方资料宣称修改SecondLevelDataCache键的值可以提高系统性能是不正确的。二级缓存的数值是由操作系统检测并且完全不受SecondLevelDataCache值的影响。

从微软知识库的文章中我们可以看到,所谓的Windows用户需要用户手动打开二级缓存这种说法是错误的。Windows系统是根据硬件抽象层读取CPU的二级缓存数值。只有在读取失败时才会读取SecondLevelDataCache的值,而且SecondLevelDataCache的默认数值0所代表的意义就是二级缓存为256KB,而不是表示关闭。所以CPU的二级缓存在任何时候都是开启的,用户没有必要再自行修改。

因此,无论是WindowsXP还是Vista都无需对此项进行优化,纯粹是自欺欺人。