Skip to content
Snippets Groups Projects
Commit 04b4a2e4 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Reduce disk cache size to 8MiB

parent 63468fc4
No related branches found
No related tags found
No related merge requests found
......@@ -20,11 +20,13 @@ pub struct DiskCache<T> {
impl<T: Disk> DiskCache<T> {
pub fn new(inner: T) -> Self {
// 8 MB cache
let size = 8 * 1024 * 1024 / BLOCK_SIZE as usize;
DiskCache {
inner,
cache: HashMap::new(),
order: VecDeque::new(),
size: 16 * 1024 * 1024 / BLOCK_SIZE as usize, // 16 MB cache
cache: HashMap::with_capacity(size),
order: VecDeque::with_capacity(size),
size,
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment