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

Bump Chi to master to fix large memory allocs #170

Merged
merged 2 commits into from
Nov 10, 2019

Conversation

markphelps
Copy link
Collaborator

Was doing some benchmarking of memory usage running vegeta and saw that memory allocs were pretty insane for compress/flate.NewWriter (up to 17105 MB) which I tracked down to chi compress middleware. This seems to create a new flate/compressor for each invocation.

Updating to master branch of chi seems to fix this by using a sync.Pool of compressors and reduces memory allocs.

Before

Screen Shot 2019-11-10 at 3 26 13 PM

After

Screen Shot 2019-11-10 at 3 39 52 PM

@markphelps markphelps merged commit 93fa3f3 into master Nov 10, 2019
@markphelps markphelps deleted the bump-chi-fix-memory-alloc branch November 10, 2019 20:57
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