File I/O for Game Developers: Past, Present, and Future with C++
Talkat CppCon 2023 · on Tuesday, 2023-10-03· at 09:00· Cottonwood 8/9, 6700 North Gaylord Rockies Boulevard·
summary
Explains concrete claims: C++ fstream often wraps C buffered IO with ~4 kilobyte buffers (BUFSIZ), that extra copies cost ~20% of IO, NVMe random latency ~300 μs versus SATA ~800 μs, and mmap or file-mapping removes those copies. Describes proposals and tools: #embed for compile‑time resources, P1031/P1041 for low‑level file handles and mmap‑style mapping, and Microsoft DirectStorage (Windows 11 + high‑end GPU) to bypass RAM. Recounts implemented hacks (memory‑map + touch threads) and measured wins and tradeoffs (address‑space reservation, prefetching).
AI-written summary · about
chapters (10)
- 0:00Introduction
- 2:46Why files and file systems
- 10:13Storage evolution: cassettes to floppies
- 17:24FAT16 and POSIX file systems
- 27:01Caching and buffering in I/O
- 36:54Buffered I/O challenges
- 41:06Memory mapping and virtual memory
- 47:49C++ future: hash_embed
- 50:45C++ future: low-level I/O library
- 54:34Summary
related talks
21mStreamCache: Revisiting Page Cache for File Scanning on Fast Storage Devices
47mExploring Linux Memory Usage and IO Performance in Cloud Native Applications
22mCombining Buffered I/O and Direct I/O in Distributed File Systems
01h 00mCache Friendly C++
55mWriting Cache-Friendly C++
36mInterfaces Matter
38mScaling IO-bound application in the cloud
58mC++ Performance and Optimisation
