Skip to content

Commit

Permalink
improvement performance (alibaba#6407)
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwen5 authored Jul 22, 2021
1 parent a64f5b5 commit 4d7ccd5
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,11 @@ public synchronized long nextId() {
}

this.lastTime = currentMillis;
logger.debug("{}-{}-{}", (new SimpleDateFormat(DATETIME_PATTERN)).format(new Date(this.lastTime)),
workerId, this.sequence);

if (logger.isDebugEnabled()) {
logger.debug("{}-{}-{}", (new SimpleDateFormat(DATETIME_PATTERN)).format(new Date(this.lastTime)),
workerId, this.sequence);
}

currentId = currentMillis - EPOCH << 22 | workerId << 12 | this.sequence;
return currentId;
Expand Down

0 comments on commit 4d7ccd5

Please sign in to comment.