commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles Honton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1248) FastDatePrinter Memory allocation regression
Date Sun, 17 Jul 2016 02:33:20 GMT

    [ https://issues.apache.org/jira/browse/LANG-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15381051#comment-15381051
] 

Charles Honton commented on LANG-1248:
--------------------------------------

Test of FastDatePrinter("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date()) comparing committed implementation
(testAppendFullDigits1) with suggested implementation (testAppendFullDigits2)

Benchmark                                       Mode  Cnt    Score   Error  Units
FastDatePrinterBenchmark.testAppendFullDigits1  avgt  200  492.378 ± 3.642  ns/op
FastDatePrinterBenchmark.testAppendFullDigits2  avgt  200  491.250 ± 3.733  ns/op

I could not bring myself to commit the full amount of additional code to gain a nS.

> 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
>            Assignee: Charles Honton
>         Attachments: MyBenchmark.java
>
>
> 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)

Mime
View raw message