mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-28 04:42:48 +08:00
deploy
This commit is contained in:
@ -1722,7 +1722,7 @@
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">缓存局部性</p>
|
||||
<p>在计算机中,数据读写速度排序是“硬盘 < 内存 < CPU 缓存”。当我们访问数组元素时,计算机不仅会加载它,还会缓存其周围的其它数据,从而借助高速缓存来提升后续操作的执行速度。链表则不然,计算机只能挨个地缓存各个节点,这样的多次“搬运”降低了整体效率。</p>
|
||||
<p>在计算机中,数据读写速度排序是“硬盘 < 内存 < CPU 缓存”。当我们访问数组元素时,计算机不仅会加载它,还会缓存其周围的其他数据,从而借助高速缓存来提升后续操作的执行速度。链表则不然,计算机只能挨个地缓存各个节点,这样的多次“搬运”降低了整体效率。</p>
|
||||
</div>
|
||||
<ul>
|
||||
<li>下表对比了数组与链表在各种操作上的效率。</li>
|
||||
|
Reference in New Issue
Block a user