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

Steve Lawrence closed DAFFODIL-2268.
------------------------------------

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

Reply via email to