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

Kristian Rosenvold edited comment on JENA-713 at 6/13/14 5:44 PM:
------------------------------------------------------------------

I have now attached am extensive testcase which covers most of FmtUtils. The 
testcase can be applied before or after "rev2.patch", it passes in both cases.

As for the comment about using the StringBuilder with the IndentedWriter 
stream, that one method reads a little weirder than the rest of the clas. It is 
still a lot more efficient though, since there is only 1 stringbuilder in 
action, whereas the old version would have numerous instances working within 
the different sub-methods allocating more strings and stringbuilders, whereas 
this revised version allocates one large string + stringbuilder.

This also means that none of the "string" versions are in use inside FmtUtils 
itself any more, and it might be possible to deprecate these. I could look at 
that once this goes through...


was (Author: krosenvold):
I have now attached am extensive testcase which covers most of FmtUtils. The 
testcase can be applied before or after "rev2.patch", it passes in both cases.

As for the comment about using the StringBuilder with the output stream, that 
one method reads a little weirder than the rest of the clas. It is still a lot 
more efficient though, since there is only 1 stringbuilder in action, whereas 
the old version would have numerous instances working within the different 
sub-methods allocating more strings and stringbuilders, whereas this revised 
version allocates one large string + stringbuilder.

This also means that none of the "string" versions are in use inside FmtUtils 
itself any more, and it might be possible to deprecate these. I could look at 
that once this goes through...

> Reduce costly string operations in utility class
> ------------------------------------------------
>
>                 Key: JENA-713
>                 URL: https://issues.apache.org/jira/browse/JENA-713
>             Project: Apache Jena
>          Issue Type: Improvement
>          Components: ARQ
>            Reporter: Kristian Rosenvold
>         Attachments: rev2.patch, testCase.patch
>
>
> The enclosed patch improves performance for all kinds of string-serialization 
> of rdf graphs. The patch improves the performance of "UpdateRequest.output" 
> by approx. 30%, whcih makes remote sparql queries  a fair bit faster. The 
> patch will probably improve performance across the board.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to