Skip to content

[MINOR] Clean up of isDebugEnabled() usages#2435

Draft
e-strauss wants to merge 1 commit intoapache:mainfrom
e-strauss:is-debug-clean-up
Draft

[MINOR] Clean up of isDebugEnabled() usages#2435
e-strauss wants to merge 1 commit intoapache:mainfrom
e-strauss:is-debug-clean-up

Conversation

@e-strauss
Copy link
Contributor

This PR is a followup to #2432 .
We have 131 Usages of LOG.isDebugEnabled()

grep -rnF "LOG.isDebugEnabled" src/main/java/org/apache/sysds | wc -l
131

This minor change refactors 15 occurrences of the 131 isDebugEnabled() call to an unconditional log.debug(), which should not introduce real overhead from my perspective.

i am not sure about the change in src/main/java/org/apache/sysds/hops/DataOp.java because i have no idea how common this op is.

if(LOG.isDebugEnabled())
LOG.debug("Begin Function "+fkey);

LOG.debug("Begin Function " + fkey);
Copy link
Contributor

Choose a reason for hiding this comment

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

The main difference here, is that the LOG.isDebugEnabled() is very cheap, while the string concatenation can be very expensive. Unfortunately to call the LOG.debug java has to resolve the string variable input, and that is the main time used, especially if Logging is disabled.

I do not know if there is a way to avoid the string concatenation, or somehow getting it delayed to after the logging is analysed to be off.

Copy link
Contributor Author

@e-strauss e-strauss Feb 18, 2026

Choose a reason for hiding this comment

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

I see your point, but isnt it in practice in micro-level noise for these simple concats? i think we might over-engineer here

Why are we sticking to apache commons logging? with the newer SLF4J we would could do stuff like this:

LOG.debug("Begin Function {}", fkey);

also SLF4J might already be used inside apachae commons logging, since it's already in the pom

@e-strauss e-strauss marked this pull request as draft February 18, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants

Comments