You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Richard S. Hall (JIRA)" <ji...@apache.org> on 2011/01/25 22:59:44 UTC
[jira] Created: (FELIX-2804) [Framework] Try to improve performance
of parseDelimitedString() in manifest parser
[Framework] Try to improve performance of parseDelimitedString() in manifest parser
-----------------------------------------------------------------------------------
Key: FELIX-2804
URL: https://issues.apache.org/jira/browse/FELIX-2804
Project: Felix
Issue Type: Improvement
Components: Framework
Affects Versions: framework-3.0.7
Reporter: Richard S. Hall
Priority: Minor
Fix For: framework-3.2.0
Currently, we are using StringBuffer and appending one character at a time while parsing a delimited string. As we discovered when implementing our custom manifest parser, such an approach is not really very efficient. It is better to keep track of beginning/ending indexes and just extracting strings as needed. We should probably do something similar here. It may not offer great improvement, but this routine is used to parse pretty long import/export headers, so you never know.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (FELIX-2804) [Framework] Try to improve performance
of parseDelimitedString() in manifest parser
Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Richard S. Hall closed FELIX-2804.
----------------------------------
Resolution: Won't Fix
Fix Version/s: (was: framework-3.2.0)
I did various experiments including synchronizing the StringBuffer and avoiding the StringBuffer altogether by just using index calculation. I did significant improvement with index calculation for a handful of runs, but any significant number of runs it didn't make a difference. For example, I saw no difference when starting GF.
> [Framework] Try to improve performance of parseDelimitedString() in manifest parser
> -----------------------------------------------------------------------------------
>
> Key: FELIX-2804
> URL: https://issues.apache.org/jira/browse/FELIX-2804
> Project: Felix
> Issue Type: Improvement
> Components: Framework
> Affects Versions: framework-3.0.7
> Reporter: Richard S. Hall
> Priority: Minor
>
> Currently, we are using StringBuffer and appending one character at a time while parsing a delimited string. As we discovered when implementing our custom manifest parser, such an approach is not really very efficient. It is better to keep track of beginning/ending indexes and just extracting strings as needed. We should probably do something similar here. It may not offer great improvement, but this routine is used to parse pretty long import/export headers, so you never know.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (FELIX-2804) [Framework] Try to improve
performance of parseDelimitedString() in manifest parser
Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12987413#action_12987413 ]
Valentin Valchev commented on FELIX-2804:
-----------------------------------------
Just a small improvement without many changes to the code would be if make place the 'for' in synchronized block:
[code]
StringBuffer sb = new StringBuffer();
int expecting = (CHAR | DELIMITER | STARTQUOTE);
synchronized(sb)
{
for (int i = 0; i < value.length(); i++)
{
.......................
}
}
[code]
This makes the performance of StringBuffer almost identical to StringBuilder.
> [Framework] Try to improve performance of parseDelimitedString() in manifest parser
> -----------------------------------------------------------------------------------
>
> Key: FELIX-2804
> URL: https://issues.apache.org/jira/browse/FELIX-2804
> Project: Felix
> Issue Type: Improvement
> Components: Framework
> Affects Versions: framework-3.0.7
> Reporter: Richard S. Hall
> Priority: Minor
> Fix For: framework-3.2.0
>
>
> Currently, we are using StringBuffer and appending one character at a time while parsing a delimited string. As we discovered when implementing our custom manifest parser, such an approach is not really very efficient. It is better to keep track of beginning/ending indexes and just extracting strings as needed. We should probably do something similar here. It may not offer great improvement, but this routine is used to parse pretty long import/export headers, so you never know.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.