HDFS-16638. Add isDebugEnabled check for debug blockLogs in BlockManager#4480
HDFS-16638. Add isDebugEnabled check for debug blockLogs in BlockManager#4480ayushtkn merged 1 commit intoapache:trunkfrom
Conversation
|
💔 -1 overall
This message was automatically generated. |
|
Thanks @cxzl25 for your patch. I have a question about it and looking forward your feedback. Or can you do some performance test for it? use this judgment or not. |
We have some JIRAs that use the |
|
I am not sure if having Looking at which would call Hence, as long as we use parameterized args |
|
Thanks @virajjasani. Like this debug log, in order to satisfy the checkStyle, we must split the log into multiple lines. So even we use parameterized args Like this debug log, do you have some good ideas? |
|
Thanks @ZanderXu, IMHO breaking the small strings like the one mentioned above (to satisfy checkstyle) is not an overhead for JVM. The overhead comes when big objects (or let's say variable size of collections) are added in the log lines. |
Yes, your are right. So maybe we should have a performance test to confirm that which of the above two modes has better performance. |
|
@cxzl25 @virajjasani @ayushtkn Share the results of my stress test here. Test code: And the result is:
So this PR is help with much performance improvement. |
|
Thank you for your help with the stress test. @ZanderXu |
|
Well I didn't expect it to be that better as the above result shows, but I don't think concat will be having a Zero overhead anyway, if the code path is critical and something called at very high frequency, even small improvements can help. |
|
I think it's fine moving forward because in the presence of this patch, the worst case scenario would be calculating if DEBUG level is enabled twice, which is nothing compared to even static String concat. Hence, no objections from my side. Thanks @cxzl25 for the work! |
|
Cool, So we are good here. @cxzl25 Can you assign the jira as well on your name, or if you can't do due to some permissions, drop a comment on the jira or let me know your jira id. Will commit post that, |
|
Thank you all for your review and help! @ayushtkn @ZanderXu @virajjasani
My jira id is |
|
Thanks @cxzl25 @virajjasani @ayushtkn . I will create a new PR to correct any debug logs in HDFS if needed. |
…ger. (apache#4480). Contributed by dzcxzl. Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
Description of PR
There are lots of concatenating Strings using
blockLog.debuginBlockManager.How was this patch tested?
exist UT
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?