Skip to content

improve send performance faster #1477

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gubaojian
Copy link

@gubaojian gubaojian commented Jun 20, 2025

  1. improve by mask 8 byte long,
  2. add log check log.isTraceEnabled() to avoid string format, which may lead performance down
  3. skip utf8 valid for already utf8 bytes
  4. expose send encoded frame binary method

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

…eEnabled() and skip utf8 valid for utf8 byte
@PhilipRoman
Copy link
Collaborator

Wow, I guess great minds think alike :) I had prepared a branch using the same optimizations after profiling. I'm not sure we want to expose some of these low level functions though.

Also, this function makes no sense:

  public void sendEncodedBinaryFrame(ByteBuffer binaryFrame) {
    List<ByteBuffer> bufs = new ArrayList<>(4);
    sendEncodedBinaryFrames(bufs);
  }

In a few days I will have time to review and/or work on this.

@gubaojian
Copy link
Author

Wow, I guess great minds think alike :) I had prepared a branch using the same optimizations after profiling. I'm not sure we want to expose some of these low level functions though.

Also, this function makes no sense:

  public void sendEncodedBinaryFrame(ByteBuffer binaryFrame) {
    List<ByteBuffer> bufs = new ArrayList<>(4);
    sendEncodedBinaryFrames(bufs);
  }

In a few days I will have time to review and/or work on this.

it can use to test send performance of io without effect by Protocol encode cost.

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