You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project implements a high-performance in-memory cache in Go, optimized for low-latency data retrieval in performance-critical systems. The codebase primarily leverages the Go standard library and select well-maintained packages to ensure operational stability, maintainability, and ease of integration into production environments.
4
+
5
+
## Coding Standards
6
+
7
+
- This is a Go (Golang) project.
8
+
- Write idiomatic, clean, and readable Go with clear inline comments where necessary.
9
+
- Prioritize performance and simplicity, with a primary focus on efficient caching mechanisms.
10
+
- Develop composable, testable functions to facilitate maintainability and reuse.
11
+
- Write unit tests using the testing package for all handlers and core logic.
12
+
- Use the Go standard library and select well-maintained packages to ensure stability and reduce dependency surface area.
13
+
- Ensure the codebase is clear, consistent, and approachable for contributors.
14
+
- Ensure go build ./... and go test ./... pass without errors before submitting changes.
15
+
- Include structured log output with contextual information to support debugging and observability.
16
+
- Write clear, descriptive commit messages outlining the purpose and scope of changes.
17
+
- If implementation guidance is needed, seek clarification promptly. Do not fabricate or assume correctness without validation.
Atomic cache is Golang fast in-memory cache (it wants to be fast - if you want to help, go ahead). Cache using limited number of shards with limited number of containing records. So the memory is limited, but the limit depends on you.
3
+
Atomic Cache is a high-performance, in-memory caching library for Go, designed for low-latency data retrieval in performance-critical systems. It uses a sharded architecture with configurable memory limits, supporting efficient storage and retrieval of byte slices with per-record expiration.
4
4
5
-
After cache initialization, only one shard is allocated. After that, if there is no left space in shard, new one is allocated. If shard is empty, memory is freed.
5
+
Atomic Cache is ideal for applications that require predictable memory usage, fast access times, and robust cache eviction strategies.
6
6
7
-
There is also support for record expiration. You can set expire time for every record in cache memory.
7
+
The library is production-ready, leverages only the Go standard library and select well-maintained dependencies, and is easy to integrate into any Go project.
For this benchmark was created memory with following specs: `1024 bytes per record`, `4096 records per shard`, `256 shards (max)`. The 1024 bytes was set.
79
+
To run benchmarks, use:
80
+
81
+
```sh
82
+
go test -bench=. -benchmem
83
+
```
84
+
85
+
For this benchmark, memory was created with the following specs: `1024 bytes per record`, `4096 records per shard`, `256 shards (max)`.
0 commit comments