Skip to content

Conversation

@rockdaboot
Copy link
Contributor

This change generates the keys and values in advance. This means the measurements of the GC impact of the cache algorithms is no longer tainted by key/value creation, which comes with a lot of heap allocations.

After

$ go run caches_gc_overhead_comparison.go -cache stdmap
Cache:              stdmap
Number of entries:  20000000
Number of repeats:  50
Value size:         100
GC pause for startup:  232.824µs
GC pause for stdmap: 5.49024ms

$ go run caches_gc_overhead_comparison.go -cache freecache
Cache:              freecache
Number of entries:  20000000
Number of repeats:  50
Value size:         100
GC pause for startup:  1.112992ms
GC pause for freecache: 26.927167ms

$ go run caches_gc_overhead_comparison.go -cache bigcache
Cache:              bigcache
Number of entries:  20000000
Number of repeats:  50
Value size:         100
GC pause for startup:  424.326µs
GC pause for bigcache: 29.979629ms

This change generates the keys and values in advance.
This means the measurements of the GC impact of the cache algorithms
is no longer tainted by key/value creation, which comes with a lot of
heap allocations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant