Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
lxzan committed Nov 17, 2023
2 parents 0f45c08 + 24607c7 commit 517ec93
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# MemoryCache
<div align="center">
<h1>MemoryCache</h1>
<img src="assets/logo.png" alt="logo" width="300px">
<h5>To the time to life, rather than to life in time.</h5>
</div>


[中文](README_CN.md)

Expand Down Expand Up @@ -84,7 +89,7 @@ func main() {
goos: linux
goarch: amd64
pkg: github.com/lxzan/memorycache/benchmark
cpu: AMD EPYC 7763 64-Core Processor
cpu: AMD EPYC 7763 64-Core Processor
BenchmarkMemoryCache_Set-4 11106261 100.6 ns/op 18 B/op 0 allocs/op
BenchmarkMemoryCache_Get-4 635988 77.30 ns/op 0 B/op 0 allocs/op
BenchmarkRistretto_Set-4 7933663 491.8 ns/op 170 B/op 2 allocs/op
Expand Down
12 changes: 8 additions & 4 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# MemoryCache
<div align="center">
<h1>MemoryCache</h1>
<img src="assets/logo.png" alt="logo" width="300px">
<h5>To the time to life, rather than to life in time.</h5>
</div>

[![Build Status][1]][2] [![codecov][3]][4]

Expand All @@ -20,7 +24,7 @@

1. 存储数据限制:受最大容量限制
2. 过期时间:支持
3. 缓存淘汰策略:类似LRU
3. 缓存淘汰策略:类似 LRU
4. GC 优化:无
5. 持久化:无
6. 锁定机制:分片和互斥锁
Expand Down Expand Up @@ -60,7 +64,7 @@ func main() {
memorycache.WithBucketSize(1000, 10000), // Bucket size, initial size and maximum capacity.
memorycache.WithInterval(5*time.Second, 30*time.Second), // Active cycle cleanup interval and expiration time.
)
defer mc.Stop()
defer mc.Stop()

mc.Set("xxx", 1, 10*time.Second)

Expand All @@ -82,7 +86,7 @@ func main() {
goos: linux
goarch: amd64
pkg: github.com/lxzan/memorycache/benchmark
cpu: AMD EPYC 7763 64-Core Processor
cpu: AMD EPYC 7763 64-Core Processor
BenchmarkMemoryCache_Set-4 11106261 100.6 ns/op 18 B/op 0 allocs/op
BenchmarkMemoryCache_Get-4 635988 77.30 ns/op 0 B/op 0 allocs/op
BenchmarkRistretto_Set-4 7933663 491.8 ns/op 170 B/op 2 allocs/op
Expand Down
Binary file added assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 517ec93

Please sign in to comment.