Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 300E519389 for ; Wed, 30 Mar 2016 14:33:26 +0000 (UTC) Received: (qmail 57656 invoked by uid 500); 30 Mar 2016 14:33:25 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 57581 invoked by uid 500); 30 Mar 2016 14:33:25 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 57558 invoked by uid 99); 30 Mar 2016 14:33:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Mar 2016 14:33:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7B57F2C033A for ; Wed, 30 Mar 2016 14:33:25 +0000 (UTC) Date: Wed, 30 Mar 2016 14:33:25 +0000 (UTC) From: "Remko Popma (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (LOG4J2-1339) AsyncLogger should not call instanceof TimestampMessage in hot path MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Remko Popma created LOG4J2-1339: ----------------------------------- Summary: AsyncLogger should not call instanceof TimestampMessage in hot path Key: LOG4J2-1339 URL: https://issues.apache.org/jira/browse/LOG4J2-1339 Project: Log4j 2 Issue Type: Bug Components: Core Affects Versions: 2.5, 2.4.1, 2.4, 2.3, 2.2, 2.1, 2.0.2, 2.0.1 Reporter: Remko Popma Assignee: Remko Popma Fix For: 2.6 With LOG4J2-744, AsyncLogger attempts to get the time from the message by calling {code} millis = message instanceof TimestampMessage ? ((TimestampMessage) message).getTimestamp() : CLOCK.currentTimeMillis() {code} for every message. The vast majority of messages are not TimestampMessages so the time is eventually obtained from the clock. However, benchmarking shows that the {{instanceof}} check is not free. It gives better performance to postpone the above logic to the background thread. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org