-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize the cache updater to minimize disk accesses
The bottleneck is disk accesses, so we rewrote the updater to to minimize them. We trade higher memory for reduced disk accesses. We: 1. Execute one big SQL query at the start to fetch the relevant previous caches. 2. Skip reading a file's data if the mtime has not changed since the previous cache update. 3. Only execute a SQLite upsert if the read data differ from the previous caches. With these optimizations, we make a lot of readdir and stat calls, but minimize file and database accesses to solely the files that have updated since the last cache run.
- Loading branch information
Showing
8 changed files
with
809 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.