[
https://issues.apache.org/jira/browse/HDFS-16638?focusedWorklogId=784945&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-784945
]
ASF GitHub Bot logged work on HDFS-16638:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 27/Jun/22 06:35
Start Date: 27/Jun/22 06:35
Worklog Time Spent: 10m
Work Description: ZanderXu commented on PR #4480:
URL: https://github.com/apache/hadoop/pull/4480#issuecomment-1166936626
@cxzl25 @virajjasani @ayushtkn Share the results of my stress test here.
Test code:
```
org.slf4j.Logger LOG = LoggerFactory.getLogger("Test");
Block b = new Block();
DatanodeInfo dn = new DatanodeInfo(EMPTY_DATANODE_ID);
List<DatanodeInfo> staleNodes = new ArrayList<>();
staleNodes.add(dn);
long beginTime = Time.monotonicNowNanos();
for (int i = 0; i < 100000000; i++) {
LOG.debug("BLOCK* invalidateBlocks: postponing " +
"invalidation of {} on {} because {} replica(s) are located on
" +
"nodes with potentially out-of-date block reports",
b, dn, staleNodes);
}
long endTime = Time.monotonicNowNanos();
LOG.info("Time1: {}", endTime - beginTime);
long beginTime1 = Time.monotonicNowNanos();
for (int i = 0; i < 100000000; i++) {
if (LOG.isDebugEnabled()) {
LOG.debug("BLOCK* invalidateBlocks: postponing " +
"invalidation of {} on {} because {} replica(s) are located
on " +
"nodes with potentially out-of-date block reports",
b, dn, staleNodes);
}
}
long endTime2 = Time.monotonicNowNanos();
LOG.info("Time2: {}", endTime2 - beginTime1);
long beginTime2 = Time.monotonicNowNanos();
for (int i = 0; i < 100000000; i++) {
LOG.debug("BLOCK* invalidateBlocks: postponing invalidation of {}", b);
}
long endTime3 = Time.monotonicNowNanos();
LOG.info("Time3: {}", endTime3 - beginTime2);
```
And the result is:
```
Time1: 353681417
Time2: 287066916
Time3: 270287253
```
So this PR is help with much performance improvement.
Issue Time Tracking
-------------------
Worklog Id: (was: 784945)
Time Spent: 1h 40m (was: 1.5h)
> Add isDebugEnabled check for debug blockLogs in BlockManager
> ------------------------------------------------------------
>
> Key: HDFS-16638
> URL: https://issues.apache.org/jira/browse/HDFS-16638
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: namenode
> Reporter: dzcxzl
> Priority: Trivial
> Labels: pull-request-available
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> There are lots of concatenating Strings using blockLog.debug in BlockManager.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]