Skip to content

Commit 36d6e76

Browse files
author
Yanbin Zhu
committed
feat(*): buffer and cache
1 parent 648899c commit 36d6e76

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

app/tag-data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"redis":1,"backend":1,"next-js":6,"tailwind":3,"guide":5,"feature":2,"multi-author":1,"hello":1,"math":1,"ols":1,"github":1,"writings":1,"book":1,"reflection":1,"holiday":1,"canada":1,"images":1,"markdown":1,"code":1,"features":1}
1+
{"markdown":1,"code":1,"features":1,"next-js":6,"math":1,"ols":1,"github":1,"guide":5,"tailwind":3,"hello":1,"holiday":1,"canada":1,"images":1,"feature":2,"writings":1,"book":1,"reflection":1,"redis":1,"backend":1,"multi-author":1}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: buffer 和 cache 的区别
3+
date: '2024-08-01'
4+
tags: ['computer principles', 'buffer','cache']
5+
draft: false
6+
summary: buffer 和 cache 的区别
7+
---
8+
9+
# what
10+
11+
Buffer,通常被称为缓冲区,是一个临时存储数据的区域。它的主要作用是在`不同速度的设备`之间`传输数据``提供平衡`
12+
13+
Cache(缓存)主要用于提高系统的响应速度。Cache的工作原理是`将经常访问的数据复制到更快的存储介质`中,如内存。这样,在`后续访问`这些数据时,系统可以`直接从缓存中读取`,而无需再从原始数据源(如硬盘)中获取。
14+
15+
# how
16+
17+
- buffer:当计算机与其他设备(如硬盘、网络设备等)进行数据交换时,由于这些设备的速度可能不同,Buffer可以确保数据在传输过程中不会丢失或混乱。通过将数据暂时存储在Buffer中,计算机可以在等待较慢设备完成数据传输的同时继续执行其他任务。
18+
19+
- cache:Cache的工作原理是将经常访问的数据复制到更快的存储介质中,如内存。这样,在后续访问这些数据时,系统可以直接从缓存中读取,而无需再从原始数据源(如硬盘)中获取。由于缓存的访问速度通常比硬盘等存储设备快得多,因此这可以显著减少数据访问时间,提高系统性能。
20+
21+
# when
22+
23+
- buffer:例如,在I/O操作中,磁盘Buffer用于暂时存储数据,以提高读写性能。
24+
25+
- cache:例如,数据库查询结果可以存储在缓存中,以减少对数据库的访问频率。
26+
27+

0 commit comments

Comments
 (0)