Skip to content

Conversation

@dqhl76
Copy link
Collaborator

@dqhl76 dqhl76 commented Dec 8, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

The tiny cost operations (e.g <usize>.to_string) cannot be ignored in heavy IO loop, which cannot be prevented even logging level is higher than DEBUG.

image

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-chore this PR only has small changes that no need to record, like coding styles. label Dec 8, 2025
@dqhl76 dqhl76 changed the title chore: reduce overhead when log level is not DEBUG chore: reduce extra overhead in heavy IO loop when log level is not DEBUG Dec 8, 2025
@dqhl76 dqhl76 added ci-cloud Build docker image for cloud test and removed ci-cloud Build docker image for cloud test labels Dec 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

Docker Image for PR

  • tag: pr-19077-96c8539-1765189943

note: this image tag is only available for internal use.

impl Logger {
#[inline]
fn debug_enabled(&self) -> bool {
log_enabled!(target: LOGGING_TARGET, Level::Debug)
Copy link
Collaborator Author

@dqhl76 dqhl76 Dec 9, 2025

Choose a reason for hiding this comment

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

This cannot work because we have a lot of logging dispatchers. If one of them on Debug level, this macro will always return true.

@dqhl76 dqhl76 closed this Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-chore this PR only has small changes that no need to record, like coding styles.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant