Skip to content
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

Use parameterized log messages instead of string concatenation #13145

Merged
merged 1 commit into from
May 15, 2024

Conversation

yashmayya
Copy link
Collaborator

  • Non-constant string concatenations are evaluated at runtime even when the actual log message isn't emitted and this has a non-zero performance impact.
  • Using parameterized log messages helps avoid this issue since the string evaluation will only occur if the logger is enabled.
  • While this change is particularly impactful for debug and trace log messages since the default log level is info, we should ideally use parameterized log messages instead of string concatenation for all log levels since log levels for loggers can be adjusted, and parameterized log messages are considered best practice.
  • This patch doesn't modify log messages that are inside a log level check if block (here, for instance).

@codecov-commenter
Copy link

codecov-commenter commented May 13, 2024

Codecov Report

Attention: Patch coverage is 3.65854% with 79 lines in your changes are missing coverage. Please review.

Project coverage is 35.16%. Comparing base (59551e4) to head (a6face7).
Report is 439 commits behind head on master.

Files Patch % Lines
...r/helix/SegmentOnlineOfflineStateModelFactory.java 0.00% 10 Missing ⚠️
.../impl/stats/SegmentPreIndexStatsCollectorImpl.java 0.00% 8 Missing ⚠️
...cordtransformer/SchemaConformingTransformerV2.java 0.00% 6 Missing ⚠️
...t/segment/local/utils/ConsistentDataPushUtils.java 0.00% 5 Missing ⚠️
...a/manager/realtime/RealtimeSegmentDataManager.java 0.00% 4 Missing ⚠️
...in/stream/kafka20/KafkaStreamMetadataProvider.java 0.00% 4 Missing ⚠️
...eam/kinesis/server/KinesisDataServerStartable.java 0.00% 4 Missing ⚠️
...in/stream/pulsar/PulsarStreamMetadataProvider.java 0.00% 4 Missing ⚠️
...pinot/query/runtime/plan/MultiStageQueryStats.java 0.00% 3 Missing ⚠️
...on/src/main/java/org/apache/pinot/serde/SerDe.java 0.00% 2 Missing ⚠️
... and 25 more
Additional details and impacted files
@@              Coverage Diff              @@
##             master   #13145       +/-   ##
=============================================
- Coverage     61.75%   35.16%   -26.59%     
+ Complexity      207        6      -201     
=============================================
  Files          2436     2440        +4     
  Lines        133233   134218      +985     
  Branches      20636    20785      +149     
=============================================
- Hits          82274    47203    -35071     
- Misses        44911    83534    +38623     
+ Partials       6048     3481     -2567     
Flag Coverage Δ
custom-integration1 ?
integration <0.01% <0.00%> (-0.01%) ⬇️
integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration2 0.00% <0.00%> (ø)
java-11 0.00% <0.00%> (-61.71%) ⬇️
java-21 35.16% <3.65%> (-26.46%) ⬇️
skip-bytebuffers-false 35.16% <3.65%> (-26.58%) ⬇️
skip-bytebuffers-true <0.01% <0.00%> (-27.73%) ⬇️
temurin 35.16% <3.65%> (-26.59%) ⬇️
unittests 46.55% <6.97%> (-15.19%) ⬇️
unittests1 46.55% <6.97%> (-0.34%) ⬇️
unittests2 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yashmayya yashmayya marked this pull request as ready for review May 13, 2024 15:01
Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for cleaning this up!

@Jackie-Jiang Jackie-Jiang merged commit 6bf0f62 into apache:master May 15, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants