Allocation Method Performance
Allocation performance 取決於 access pattern、file size、device type 與 cache,不是單純哪個 method 最快。
Quick Comparison
| Method | Sequential access | Random/direct access | Growth | Main risk |
|---|---|---|---|---|
| D-OS-Ch14da-Contiguous_Allocation | excellent | excellent:start+i | poor | fragmentation / relocation |
| D-OS-Ch14db-Linked_Allocation | acceptable | poor:must chase chain | excellent | pointer corruption / seek |
| D-OS-Ch14dc-Indexed_Allocation | good if blocks local | good if index cached | good | index overhead / extra I/O |
| D-OS-Ch14daa-Extent | excellent within extent | good:range lookup | good | too many extents |
HDD vs NVM
- HDD:seek / rotational latency 貴;contiguous runs、extents、block groups、read-ahead 很重要。
- NVM / SSD:沒有 mechanical seek;更關心 metadata lookup cost、write amplification、parallel queues、D-OS-Ch14ed-TRIM。
Rule of Thumb
- Small files:direct pointers 或小型 metadata,避免一個小檔配一整個大 index。
- Large sequential files:large extents + read-ahead。
- Random-access files:indexed / extent-tree mapping。
- Metadata-heavy workloads:journal / COW / cache ordering 會決定實際 latency。