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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]