-
Notifications
You must be signed in to change notification settings - Fork 378
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
Reduce GC overhead by using custom memory allocator #8
Comments
You will likely want to use a SeqLock when reading from / writing into the byte[] value. See Java's StampedLock API and internal algorithm notes for details |
What is the GC overhead here? |
Are you planning on using memory ballast for reducing GC cycles? @mangalaman93 |
Memory ballast doesn't make sense for ristretto and if it would make sense it's still something the application should do by itself, not the library. |
A custom memory allocator doesn't make sense either seeing as ristretto only stores |
My intention here is to understand what is the overhead of GC that this issue tries to reduce by the memory allocator. @mangalaman93 |
I don't think this issue was created to reduce the amount of GC cycles. This is not something a custom memory allocator would change. What this issue is about is that you want to have less pointers for the GC to check, so it runs faster. Using a custom memory allocator you can put everything in a |
I see. I would love to learn more about it. Is this what you are talking about? https://segment.com/blog/allocation-efficiency-in-high-performance-go-services/ If not, can you suggest some reading? |
Both bigcache and https://github.com/coocood/freecache#how-it-is-done use different techniques to avoid having too many pointers. |
@erikdubbelboer I think you know VictoriaMetric have FastCache repo as well, is it a good example for reference reading? |
Yes fastcache is also very good. I didn't mention it because it has a bit more complex way to deal with lowering GC overhead. |
@mangalaman93 is this issue still relevant? |
I think so, because the way Ristretto stores data is all pointers. The more the data, GC effects are gonna be more and more visible. |
Github issues have been deprecated. |
No description provided.
The text was updated successfully, but these errors were encountered: