|
1 | | -# 🚀 EasyCache - A Fast In-Memory Cache for Go |
| 1 | +## 🚀 EasyCache - A simple way to use in-memory cache in Golang |
2 | 2 |
|
3 | 3 | [](https://golang.org/) |
4 | 4 | [](https://pkg.go.dev/github.com/hugocarreira/easycache) |
5 | 5 | [](https://github.com/hugocarreira/easycache/actions) |
6 | 6 | [](https://goreportcard.com/report/github.com/hugocarreira/easycache) |
7 | | -[](https://www.codetriage.com/hugocarreira/easycache) |
8 | 7 | [](https://hugocarreira/easycache/releases) |
9 | 8 | [](LICENSE) |
10 | 9 |
|
@@ -255,34 +254,6 @@ c := cache.New(&cache.Config{ |
255 | 254 | }) |
256 | 255 | ``` |
257 | 256 |
|
258 | | - |
259 | | -## 🚀 Performance Benchmarks |
260 | | - |
261 | | -We ran performance benchmarks on EasyCache to measure the efficiency of `Set()`, `Get()`, `Delete()`, and eviction policies (`FIFO`, `LRU`, `LFU`). |
262 | | - |
263 | | -| Benchmark | Iterations | Time per operation | Memory used | Allocations per op | |
264 | | -|--------------------------|------------|--------------------|-------------|--------------------| |
265 | | -| **`BenchmarkCacheSet`** | 2,936,356 | **408.4 ns/op** | **122 B/op** | **5 allocs/op** | |
266 | | -| **`BenchmarkCacheGet`** | 39,143,538 | **30.79 ns/op** | **0 B/op** | **0 allocs/op** | |
267 | | -| **`BenchmarkCacheDelete`**| 5,376,940 | **223.3 ns/op** | **96 B/op** | **3 allocs/op** | |
268 | | -| **`BenchmarkFIFOEviction`** | 3,065,480 | **391.7 ns/op** | **122 B/op** | **5 allocs/op** | |
269 | | -| **`BenchmarkLRUEviction`** | 3,045,759 | **402.1 ns/op** | **122 B/op** | **5 allocs/op** | |
270 | | -| **`BenchmarkLFUEviction`** | 2,916,150 | **394.3 ns/op** | **88 B/op** | **4 allocs/op** | |
271 | | - |
272 | | -**Tested on:** |
273 | | -- **Go Version:** 1.23.5 |
274 | | -- **Cache Configuration:** `MaxSize = 10,000`, `TTL = 60s` |
275 | | - |
276 | | ---- |
277 | | - |
278 | | -### 🛠️ Running the Benchmarks |
279 | | - |
280 | | -To run the benchmarks yourself, use: |
281 | | - |
282 | | -```sh |
283 | | -go test -bench=. -benchmem ./tests |
284 | | -``` |
285 | | - |
286 | 257 | ## 💡 Contributing |
287 | 258 |
|
288 | 259 | Please see [`CONTRIBUTING`](CONTRIBUTING.md) for details on submitting patches and the contribution workflow. |
|
0 commit comments