bustub
bustub copied to clipboard
Why not use IO_DIRECT in src/storage/disk/disk_manager.cpp to improve efficiency?
Now that we have managed the disk cache ourselves, why not use IO_DIRECT to reduce memory copies?
Yes we should be using direct I/O. Please send a patch. Thanks!
Note that this will impose buffer size and alignment requirements and assuming you want the data durable, still requires explicit fsync
calls which is often the bottleneck for disk IO performance.
see discussion here: https://www.percona.com/blog/2018/02/08/fsync-performance-storage-devices/
Please benchmark your proposed changes when you submit a patch. Also please ensure cross-platform compatibility (macOS does not have O_DIRECT
and instead uses fcntl
to disable write cache).
It should be an interesting experiment! Good luck!