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

[python] Optimize batch serialization #1223

Merged
merged 2 commits into from
Oct 27, 2023

Conversation

frankfliu
Copy link
Contributor

Description

Brief description of what this PR is about

  • If this change is a backward incompatible change, why must this change be made?
  • Interesting edge cases to note here

@frankfliu frankfliu requested review from zachgk and a team as code owners October 26, 2023 04:22
if key.startswith(prefix):
key = key[length:]
if key.startswith("batch_"):
key = key[10:]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why 10?

msg += struct.pack('>h', len(data))
for k, v in data.items():
Output.write_utf8(msg, k)
Output.write_utf8(msg, str(v))
Copy link
Contributor

Choose a reason for hiding this comment

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

This part can still improve

@frankfliu frankfliu merged commit 4a5a979 into deepjavalibrary:master Oct 27, 2023
8 checks passed
@frankfliu frankfliu deleted the optimize branch October 27, 2023 04:59
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