You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Mike Beckerle (Jira)" <ji...@apache.org> on 2021/01/07 20:27:00 UTC
[jira] [Updated] (DAFFODIL-1480) Performance: revisit
EntityReplacer
[ https://issues.apache.org/jira/browse/DAFFODIL-1480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mike Beckerle updated DAFFODIL-1480:
------------------------------------
Labels: beginner (was: )
> Performance: revisit EntityReplacer
> -----------------------------------
>
> Key: DAFFODIL-1480
> URL: https://issues.apache.org/jira/browse/DAFFODIL-1480
> Project: Daffodil
> Issue Type: Improvement
> Components: Back End, Performance
> Reporter: Mike Beckerle
> Priority: Minor
> Labels: beginner
>
> ... we need to start looking into refactoring all the EntityReplacer code. Regular expressions are used very heavily, and results in the creation of a lot of strings (noticed during profiling). And things like input.split("""%""") takes that string, compiles it as a regular expression, and then creates new strings. So that's fairly intensive to be doing at runtime, and there's a lot of it. I feel like the right algorithm would just loop through each character in the string and based on what it sees it adds characters to another. It may add the same character it just saw, it may add a space if it saw %WSP;, it may add a outputNewLine if it saw %NL;, etc.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)