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 network types IO #286

Merged
merged 3 commits into from
Sep 7, 2024
Merged

Optimize network types IO #286

merged 3 commits into from
Sep 7, 2024

Conversation

layou233
Copy link
Contributor

@layou233 layou233 commented Sep 1, 2024

Few things optimized:

  1. Use encoding/binary for binary conversions.
  2. Add CreateByteReader to avoid type assertions on every read.
  3. Improve VarInt and VarLong write. (ported from Velocity, this part of code is licensed under MIT by the author)

I've unrolled the loop for VarInt (like what Velocity has done), but kept the loop for VarLong because it's probably too long, and VarInt is used more often than VarLong. Should I also unroll it?

@Tnze Tnze merged commit 9a1f543 into Tnze:master Sep 7, 2024
4 checks passed
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