Evan Zhou
Evan Zhou
Have you met any issue in your application? The expire feature does not work as expected?
When the values and keys are small, `expand` could take a portion of the total memory.
Because entry pointers memory is allocated separated, there is no limit for it.
What's the hardware and OS environment? Are there other processes running on the same machine?
The alignment is for 32bit systems where `int` is 32bit
Have you checked out the PR that introduce this alignment? https://github.com/coocood/freecache/pull/38
Most of the time, marshal/unmarshal would be much more expensive than lookup. But if you have many CPU cores and access your cache concurrently, freecache may worth using.
`RWMutex` may perform worse than `Mutex` if there is very little contention.
> > `RWMutex` may perform worse than `Mutex` if there is very little contention. > > Can u explain more about why RWMutex may perform worse than Mutex ? RWMutex...
It's caused by capacity is zero, then `(capacity + segment_length - 1) / segment_length` is zero, less than `(arity - 1)` ``` let capacity: u32 = if size > 1...