allegro/bigcache

Efficient cache for gigabytes of data written in Go.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 21 minutes ago
Added to GitGenius on September 8th, 2026
Created on March 23rd, 2016
Open Issues & Pull Requests: 96 (+0)
GitHub issues: Enabled
Number of forks: 613
Total Stargazers: 8,161 (+0)
Total Subscribers: 103 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 12.3 days
Mean response time: 525.0 days
90th percentile: 1886.3 days
Tracked items: 15

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 12
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,019 days
Stale 30+ days: 11
Stale 90+ days: 11

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (12)
  • enhancement (2)
  • good-first-issue (1)
  • question (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

BigCache is an in-memory cache library for Go designed to efficiently store gigabytes of data without triggering garbage collection overhead.

The problem BigCache solves is that standard Go maps and caches cause significant garbage collection pauses when storing large numbers of entries. The tool achieves this by leveraging a Go runtime optimization that skips garbage collection for maps with non-pointer keys and values. BigCache uses a map of hashes to byte offsets, storing actual entry data in byte slices. Since the garbage collector only sees a single pointer to each byte slice rather than individual entries, it avoids scanning millions of cached objects even when the cache grows to gigabyte scale.

BigCache suits projects that need to cache large datasets in-memory while maintaining predictable latency. It works best when you can afford to handle entry serialization and deserialization yourself, since the cache operates on raw byte slices. The tool is particularly valuable for systems where garbage collection pauses are a bottleneck. Compared to Freecache, which implements custom mapping on slices, BigCache achieves faster writes and reads while maintaining similar garbage collection pause times. Unlike a standard map, BigCache provides automatic entry expiration through configurable LifeWindow and CleanWindow parameters.

The project maintains active continuous integration with build status tracking. Development includes comprehensive benchmarking infrastructure that compares performance against alternative caching approaches. The codebase includes detailed documentation of its memory behavior and the specific Go runtime optimization it depends on, acknowledging expected patterns in system memory reporting that users may encounter.