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

Tr 2037 Compute msg size after compress #45

Merged
merged 3 commits into from
Jan 6, 2020
Merged

Tr 2037 Compute msg size after compress #45

merged 3 commits into from
Jan 6, 2020

Conversation

mccammon
Copy link
Contributor

  • Compute msg size after compress in extendedSend().
  • Fix minor bug where need to compensate for payload size increase after compressing with no compression (~50bytes difference).

Scott McCammon added 2 commits December 31, 2019 12:30
…o compression & re-compute message size after compression of payload
test/unit/lib/sqs.spec.js Outdated Show resolved Hide resolved
/*
* Max size of message that does not need to be compressed as it can be sent via 1 SQS Operation
* 64kb => b: (64kb * 1024 bytes = 65536 bytes - 50 bytes = 65486)
* -50 bytes to compensate for size increase after compressing with no compression level
Copy link
Contributor

Choose a reason for hiding this comment

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

how did we settle on 50 bytes for this buffer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Series of test up to 64kb never saw more than 40 bytes added post compression with no compression rate. Added another 10 byte buffer for good measure.

Copy link
Contributor

@ischer ischer left a comment

Choose a reason for hiding this comment

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

lgtm!

@mccammon mccammon merged commit 8ad50ee into master Jan 6, 2020
@mccammon mccammon deleted the TR-2037 branch January 7, 2020 18:06
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.

2 participants