commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Commented] (LANG-1248) FastDatePrinter Memory allocation regression
Date Tue, 05 Jul 2016 20:53:11 GMT


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:
>             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

View raw message