Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make GC comparisons more realistic #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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