Allocation Method Performance

Allocation performance 取決於 access pattern、file size、device type 與 cache,不是單純哪個 method 最快。


Quick Comparison

MethodSequential accessRandom/direct accessGrowthMain risk
D-OS-Ch14da-Contiguous_Allocationexcellentexcellent:start+ipoorfragmentation / relocation
D-OS-Ch14db-Linked_Allocationacceptablepoor:must chase chainexcellentpointer corruption / seek
D-OS-Ch14dc-Indexed_Allocationgood if blocks localgood if index cachedgoodindex overhead / extra I/O
D-OS-Ch14daa-Extentexcellent within extentgood:range lookupgoodtoo 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。