Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 21307200B35 for ; Tue, 5 Jul 2016 22:53:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1FE3E160A2C; Tue, 5 Jul 2016 20:53:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 766E7160A76 for ; Tue, 5 Jul 2016 22:53:12 +0200 (CEST) Received: (qmail 31347 invoked by uid 500); 5 Jul 2016 20:53:11 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 31255 invoked by uid 99); 5 Jul 2016 20:53:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jul 2016 20:53:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 39B002C02A5 for ; Tue, 5 Jul 2016 20:53:11 +0000 (UTC) Date: Tue, 5 Jul 2016 20:53:11 +0000 (UTC) From: "Sebb (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LANG-1248) FastDatePrinter Memory allocation regression MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 05 Jul 2016 20:53:13 -0000 [ https://issues.apache.org/jira/browse/LANG-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15363223#comment-15363223 ] Sebb commented on LANG-1248: ---------------------------- Another possible approach is to check for an instance of AbstractStringBuffer; if so, then use setCharAt(int, char) In the case of CharBuffer, one can use put(int, char) In any other case (e.g. PrintStream or Writer), use the existing implementation. That should reduce the memory allocation for the commonest cases. > FastDatePrinter Memory allocation regression > -------------------------------------------- > > Key: LANG-1248 > URL: https://issues.apache.org/jira/browse/LANG-1248 > Project: Commons Lang > Issue Type: Bug > Components: lang.time.* > Affects Versions: 3.5 > Reporter: Benoit Wiart > > when the code was migrated from StringBuffer to Appendable in LANG-1152. > We've lost the ability to modify the buffer (setCharAt) > The new implementation of appendFullDigits allocate a temporary char array to work around that limitation. > This is a major source of memory allocation which is not present in version 3.4. -- This message was sent by Atlassian JIRA (v6.3.4#6332)