You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Steve Lawrence (Jira)" <ji...@apache.org> on 2021/02/18 20:59:00 UTC

[jira] [Resolved] (DAFFODIL-2268) Optimization: reduce number of DecimalFormat's created for TextNumberParsers

     [ https://issues.apache.org/jira/browse/DAFFODIL-2268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Lawrence resolved DAFFODIL-2268.
--------------------------------------
    Resolution: Won't Fix

Need evidence that this is a real memory/performance issue before fixed. Closing until profiling shows this is needed.

> Optimization: reduce number of DecimalFormat's created for TextNumberParsers
> ----------------------------------------------------------------------------
>
>                 Key: DAFFODIL-2268
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2268
>             Project: Daffodil
>          Issue Type: Bug
>            Reporter: Steve Lawrence
>            Priority: Major
>
> We currently have a TextNumberEv Evalutable that creates a ThreadLocal DecimalFormat. And every single numeric text element will have it's own unique TextNumberEv (and thus DecimalFormat), even if all the text number properties are exactly the same. Most schemas will probably have at most just a handful of unique text number properties so having a unique TextNumberEv and DecimalFormat for every one is wasteful. Instead, we should have some sort of cache so that TextNumberEv's with the same properties can reuse an already created DecimalFormat.
> A thing to keep in mind is that DecimalFormat is not thread safe, this this cache must use ThreadLocals or something avoid racey code. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)