You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Timothee Maret (JIRA)" <ji...@apache.org> on 2016/08/23 15:12:20 UTC

[jira] [Commented] (SLING-5990) [SCD] FileBackedMemoryOutputStream is 10x slower than file buffering for large files

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

Timothee Maret commented on SLING-5990:
---------------------------------------

It seems that two things can be improved in order to obtain better performances

1. Override the {{java.io.OutputStream#write(byte[], int, int)}} signature in {{FileBackedMemoryOutputStream}}. Indeed, by default the muti byte write implementation does delegate to the single byte (technically it's an {{int}}) write method which is much slower than multi-byte write.

2. It seems streaming only starts when the whole binary is completely buffered (in memory and/or file). The buffering time implies a latency which which could be avoided by streaming directly.

> [SCD] FileBackedMemoryOutputStream is 10x slower than file buffering for large files
> ------------------------------------------------------------------------------------
>
>                 Key: SLING-5990
>                 URL: https://issues.apache.org/jira/browse/SLING-5990
>             Project: Sling
>          Issue Type: Bug
>          Components: Distribution
>    Affects Versions: Content Distribution 0.2.0
>            Reporter: Timothee Maret
>            Assignee: Timothee Maret
>             Fix For: Content Distribution 0.2.0
>
>
> When doing performance test SDC agents and the following configuration, the distribution is ~10x slower than when using a regular file buffering method.
> The parameters are the following
> * fileThreashol = 1
> * memoryUnit = MB
> * useOffHeapMemory = false
> * tempDirectory = null
> * fileName = distrpck-create-
> * fileExtension = .default
> The size of the binary is 80MB. 
> With the setup, it takes 12-14sec to replicate
> With a simple FileOutputStream mechanism, it takes around 1.4 sec to replicate



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)