perf(cache): increase L1 to 400MB and L2 to 800MB

L1 (memory): 300MB -> 400MB (+100MB)
L2 (disk):   500MB -> 800MB (+300MB)
This commit is contained in:
vicrodh committed 2026-02-23 08:55:33 -06:00
1 parent c761ff1fd7
commit 9db1e5ca6b
4 files changed
+13 -13

No files matched your search

+1 -1
View File
@@ -43,7 +43,7 @@ pub struct AudioCache {
impl Default for AudioCache {
fn default() -> Self {
Self::new(300 * 1024 * 1024) // 300MB for ~3-4 Hi-Res tracks
Self::new(400 * 1024 * 1024) // 400MB for ~4-5 Hi-Res tracks
}
}
+6 -6
View File
@@ -1,8 +1,8 @@
//! QBZ Cache - Audio caching system
//!
//! Provides two-level caching for audio data:
//! - **L1 (Memory)**: In-memory LRU cache (~300MB, fast access)
//! - **L2 (Disk)**: Disk-based playback cache (~500MB, persistent)
//! - **L1 (Memory)**: In-memory LRU cache (~400MB, fast access)
//! - **L2 (Disk)**: Disk-based playback cache (~800MB, persistent)
//!
//! ## Architecture
//!
@@ -15,7 +15,7 @@
//! ┌─────────────────────────────────────────────────────────┐
//! │ L1 Memory Cache (AudioCache) │
//! │ - Fast HashMap + LRU tracking │
//! │ - ~300MB limit (3-4 Hi-Res tracks) │
//! │ - ~400MB limit (3-4 Hi-Res tracks) │
//! │ - Evicted tracks spill to L2 │
//! └─────────────────────────────────────────────────────────┘
//! │ miss/evict
@@ -23,7 +23,7 @@
//! ┌─────────────────────────────────────────────────────────┐
//! │ L2 Disk Cache (PlaybackCache) │
//! │ - File-based storage │
//! │ - ~500MB limit │
//! │ - ~800MB limit │
//! │ - LRU eviction by access time │
//! └─────────────────────────────────────────────────────────┘
//! │ miss
@@ -38,11 +38,11 @@
//! use std::sync::Arc;
//!
//! // Create L2 disk cache
//! let playback_cache = Arc::new(PlaybackCache::new(500 * 1024 * 1024).unwrap());
//! let playback_cache = Arc::new(PlaybackCache::new(800 * 1024 * 1024).unwrap());
//!
//! // Create L1 memory cache with L2 spillover
//! let audio_cache = AudioCache::with_playback_cache(
//! 300 * 1024 * 1024,
//! 400 * 1024 * 1024,
//! playback_cache.clone()
//! );
//!