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

Remove unnecessary usage of ObjectSerializationCache

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.4.0
    • core
    • None

    Description

      We create an instance of ObjectSerializationCache  at https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/network/RequestChannel.scala#L113 which does not get used at all. We always "add" to the cache but never retrieve from it (as is evident by the fact that we don't store the reference of the cache anywhere).

      Adding information to the cache is expensive because it uses System.identityHashCode(Object) which is expensive as demonstrated by the flame graph of producer requests over Apache Kafka 3.3.1 plaintext broker.

      Attachments

        1. producer-only-cpu-33-clean.html
          55 kB
          Divij Vaidya
        2. Screenshot 2022-11-21 at 19.23.53.png
          188 kB
          Divij Vaidya

        Issue Links

          Activity

            People

              divijvaidya Divij Vaidya
              divijvaidya Divij Vaidya
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: