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

Optimize _encode_multipart_message #75

Merged

Conversation

dimrozakis
Copy link
Contributor

See commit messages for more details. The changes were initially implemented on top of v0.53 (due to #70 (comment)) but I cherry-picked them on top of master to open a PR.

By using BytesIO while generating the body instead of continuous string
concatenations.

This drastically reduces execution time by not recreating the string for
each concatenation.

In one case, execution time fell from 140 seconds to 0.14; three orders
of magnitude!
@hackermd hackermd added the enhancement New feature or request label Nov 13, 2022
@hackermd hackermd self-assigned this Nov 13, 2022
@hackermd hackermd self-requested a review November 13, 2022 20:45
@hackermd hackermd merged commit d7b1552 into ImagingDataCommons:master Nov 13, 2022
@dimrozakis
Copy link
Contributor Author

Thanks!

@dimrozakis dimrozakis deleted the optimize_encode_multipart branch November 14, 2022 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants