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 message serialization #120

Merged
merged 3 commits into from
May 12, 2020
Merged

Optimize message serialization #120

merged 3 commits into from
May 12, 2020

Conversation

deathaxe
Copy link
Contributor

@deathaxe deathaxe commented May 9, 2020

This commit modifies the JsonRPCProtocol._send_data() method in order to avoid duplicated utf-8 encoding of body content.

Up to this commit the serialized json payload was encoded to just receive its length and once more together with the whole content header.

The header and body are created, encoded and streamed independently, now.

Description (e.g. "Related to ...", etc.)

Please replace this description with a concise description of this Pull Request.

Code review checklist (for code reviewer to complete)

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Commit messages are meaningful (see this for details)
  • Tests have been included and/or updated, as appropriate
  • Docstrings have been included and/or updated, as appropriate
  • Standalone docs have been updated accordingly
  • CONTRIBUTORS.md was updated, as appropriate
  • Changelog has been updated, as needed (see CHANGELOG.md)

deathaxe added 3 commits May 9, 2020 11:56
This commit modifies the `JsonRPCProtocol._send_data()` method in order
to avoid duplicated utf-8 encoding of body content.

Up to this commit the serialized json payload was encoded to just
receive its length and once more together with the whole content header.

The `header` and `body` are created, encoded and streamed independently, now.
Maybe its more safe as we are running asyncio loops and threads.
@danixeee danixeee self-requested a review May 12, 2020 09:39
@danixeee danixeee added the enhancement New feature or request label May 12, 2020
Copy link
Contributor

@danixeee danixeee left a comment

Choose a reason for hiding this comment

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

Looks good.

@danixeee danixeee merged commit 3ef0b7d into openlawlibrary:master May 12, 2020
@deathaxe deathaxe deleted the pr/message-serialization branch March 15, 2021 19:38
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