kafka icon indicating copy to clipboard operation
kafka copied to clipboard

MINOR: Change config. compressionType to be an enum type instead

Open testn opened this issue 1 year ago • 1 comments

Currently, LogConfig.compressionType is a string so UnifiedLog.append has to convert string into enum all the time which seems to waste a lot of CPU time for something that is rarely changed.

This change makes LogConfig.compressionType to be the parsed enum so that the caller can use it directly without parsing enum every time.

A crude benchmark seems to be improved by 3-5%

Committer Checklist (excluded from commit message)

  • [X] Verify design and implementation
  • [X] Verify test coverage and CI build status
  • [X] Verify documentation (including upgrade notes)

testn avatar Feb 21 '24 09:02 testn

The build is failing because we need to modify a few other tests to use enum instead of string. Please tag me here again for review once we have a green build.

divijvaidya avatar Feb 23 '24 10:02 divijvaidya

Hey @testn Tests in the CI seem to be failing due to this change such as https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-15403/6/testReport/junit/kafka.server/DynamicConfigChangeTest/Build___JDK_11_and_Scala_2_13___testMessageFormatVersionChange_String__quorum_zk/

You can verify them by running ./gradlew test locally. Please check and fix them.

divijvaidya avatar Mar 08 '24 16:03 divijvaidya

This PR is being marked as stale since it has not had any activity in 90 days. If you would like to keep this PR alive, please ask a committer for review. If the PR has merge conflicts, please update it with the latest from trunk (or appropriate release branch)

If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.

github-actions[bot] avatar Jun 24 '24 03:06 github-actions[bot]

I think a similar change has been done via https://github.com/apache/kafka/commit/affe8da54c96d4038481c3807d059134961445a3. Closing.

mimaison avatar Jun 27 '24 09:06 mimaison