Skip to content

[memory opt] Downsize decompression buffers when large for too long#2069

Merged
bimbashrestha merged 8 commits intofacebook:devfrom
bimbashrestha:doversize
Apr 6, 2020
Merged

[memory opt] Downsize decompression buffers when large for too long#2069
bimbashrestha merged 8 commits intofacebook:devfrom
bimbashrestha:doversize

Conversation

@bimbashrestha
Copy link
Contributor

@terrelln
Copy link
Contributor

terrelln commented Apr 3, 2020

Please add a test, you should be able to use ZSTD_sizeof_DCtx() to test it.

Copy link
Contributor

@felixhandte felixhandte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good overall. Suggestions inline.

@Cyan4973
Copy link
Contributor

Cyan4973 commented Apr 3, 2020

Looks good to me. It's a clean patch, great work @bimbashrestha !
I believe the only remaining comment is from @terrelln , about a need to add a test to ensure the downsizing happens as expected (there is already such a test for CCtx, it could be extended to also cover DCtx).

And just FYI, since I did not participate on earlier discussion on this topic, I was not opposed on having separate constants for compression and decompression states, since it would allow differentiated policy if need be. But indeed, the names of constants should reflect their respective scope.

That being said, there's no urgency. We can start by using the same constants and therefore same policy for both DCtx and CCtx. We can always add new specific constants later if the need arises.

Copy link
Contributor

@terrelln terrelln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once the test is added.

@bimbashrestha bimbashrestha requested a review from terrelln April 6, 2020 17:30
@bimbashrestha bimbashrestha merged commit 2847d1a into facebook:dev Apr 6, 2020
@Cyan4973 Cyan4973 mentioned this pull request May 21, 2020
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.

5 participants