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

[Ruby] Fixed quadratic memory usage when appending to arrays. #8364

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

haberman
Copy link
Member

@haberman haberman commented Mar 2, 2021

The code mistakenly called realloc() instead of resize() on every
array append, causing quadratic memory usage.

This fixes the problem reported in #8337 (comment)

The code mistakenly called realloc() instead of resize() on every
array append, causing quadratic memory usage.
@haberman haberman merged commit 069f989 into protocolbuffers:master Mar 2, 2021
@hatstand
Copy link

hatstand commented Mar 4, 2021

@haberman @acozzette I don't think this made it into 3.15.4 AFAICT and it's mistakenly in the release notes there. https://github.com/protocolbuffers/protobuf/blob/v3.15.4/ruby/ext/google/protobuf_c/ruby-upb.c#L6666

@haberman
Copy link
Member Author

haberman commented Mar 4, 2021

@hatstand thanks for the heads-up, I mistakenly merged it to the wrong branch.

Here is a follow-up that will go out in 3.15.5: #8379

This was referenced Mar 14, 2021
@haberman haberman deleted the ruby-memory-footprint branch April 20, 2021 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants