Disk: ReadDriver: Add unified cache

Previously, we had to copy an entire block out of the
old cache every time we wanted to read even a single
byte from it.

This ended up being a fairly significant performance
issue, in addition to the fact that the caching code
was duplicated.
This commit is contained in:
Paul Hollinsky
2022-04-14 18:26:44 -04:00
parent d45d708446
commit 103f938d69
10 changed files with 316 additions and 245 deletions
@@ -27,11 +27,6 @@ public:
private:
static constexpr const uint8_t MemoryTypeSD = 0x01; // Logical Disk
static constexpr const std::chrono::seconds CacheTime = std::chrono::seconds(1);
std::array<uint8_t, SectorSize> cache;
uint64_t cachePos = 0;
std::chrono::time_point<std::chrono::steady_clock> cachedAt;
Access getPossibleAccess() const override { return Access::VSA; }