Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-16397

Use ByteBufferOutputStream to avoid array copy

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.8.0
    • None
    • None

    Description

      from https://github.com/apache/kafka/pull/15148#discussion_r1531889679

      source code:
      https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/telemetry/internals/ClientTelemetryUtils.java#L216

      we can use ByteBufferOutputStream to collect the uncompressed data, and then return the inner buffer directly instead of copying full array.

      Attachments

        Activity

          People

            chiacyu Chia-Chuan Yu
            chia7712 Chia-Ping Tsai
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: