lolly/internal
xfy e44cfc7128 perf(handler): eliminate read-lock upgrade in FileInfoCache.Get with approximate LRU
FileInfoCache.Get previously acquired TWO locks on every cache hit:
1. RLock → check existence + TTL
2. Release RLock → Lock → MoveToFront (LRU update) → Unlock

The MoveToFront on every hit forced a read-to-write lock upgrade,
creating contention under concurrent reads.

Apply approximate LRU: skip MoveToFront on Get (read) path entirely.
LRU position is only updated in Set (write) path. This is the same
pattern already used by internal/cache/file_cache.go.

Result: Get fast path reduced from 2 lock acquisitions to 1 RLock.
TTL-expired entries still use double-check locking for safe removal.
2026-06-04 00:13:29 +08:00
..
2026-06-03 16:36:23 +08:00