Skip to content

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.

@bnschrollo0-dot
Copy link

So good to know you

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.

3 participants