synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Asankha C. Perera (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SYNAPSE-211) Improve performance in XSLTMediator when temporary files are used
Date Fri, 25 Apr 2008 03:29:57 GMT

    [ https://issues.apache.org/jira/browse/SYNAPSE-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592258#action_12592258
] 

Asankha C. Perera commented on SYNAPSE-211:
-------------------------------------------

Yes, setting the error on the mediator is a bug.. and we should fix it as soon as we can :D..


I think throwing the error like you suggest would be fine..

> Improve performance in XSLTMediator when temporary files are used
> -----------------------------------------------------------------
>
>                 Key: SYNAPSE-211
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-211
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.1, NIGHTLY
>            Reporter: Andreas Veithen
>            Priority: Minor
>             Fix For: 1.2
>
>
> The XSLT mediator has a mechanism to stream the result of the transformation to a temporary
file when its size exceeds some threshold (defined by BYTE_ARRAY_SIZE, which has a fixed value
of 8192). However, when this happens, the transformation is actually triggered twice. During
the first run, the result is sent to a FixedByteArrayOutputStream which will raise a SynapseException
after the first 8192 bytes have been written. The transformation is then restarted using a
FileOutputStream for the result. This is very bad for two reasons:
> * It introduced an overhead (the first attempt to execute the transformation) for every
large XML that is processed.
> * It makes the choice of the threshold BYTE_ARRAY_SIZE difficult: a small value is bad
for smaller XML documents (because temporary files are used where this is not necessary) but
good for larger ones (because it reduces the overhead caused by the first transformation attempt);
a large value is good for smaller XML documents (avoids temporary files) but bad for larger
ones (increased overhead for the first transformation).
> A better approach would be to have an OutputStream implementation that will first write
to a byte array and once the threshold is exceeded transparently switches to a temporary file,
so that the transformation is always run only once.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Mime
View raw message