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

How does this compare to sync.Pool? #5

Open
xeoncross opened this issue Feb 20, 2018 · 2 comments
Open

How does this compare to sync.Pool? #5

xeoncross opened this issue Feb 20, 2018 · 2 comments

Comments

@xeoncross
Copy link

sync.Pool seems to offer the same features so I'm wondering what differences exist between these projects.

@elithrar
Copy link
Contributor

sync.Pool automatically GC's objects, which may not be what you want.

I wrote a short piece on the differences: http://blog.questionable.services/article/using-buffer-pools-with-go/#postscript

There are also a number of issues about sync.Pool that describe its limitations:

@xeoncross
Copy link
Author

Thank you, these links were very helpful. Perhaps you should add them to the readme.

The automatic garbage collection of sync.Pool seems like it would kind of defeat the purpose of having a pool to prevent GC. I'll have to study it more.

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

No branches or pull requests

2 participants