james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <server-...@james.apache.org>
Subject [jira] [Commented] (JAMES-2343) Use buffered file output stream for MimeMessageInputStreamSource
Date Thu, 26 Apr 2018 16:28:00 GMT

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

ASF GitHub Bot commented on JAMES-2343:
---------------------------------------

Github user chikei commented on the issue:

    https://github.com/apache/james-project/pull/105
  
    As why I didn't choose wrapping DeferredFileOutputStream with BufferedOutputStream:
    1. the buffer is completely useless for message smaller than threshold (which I believe
is not a small percentage ?) yet still using memory.
    2. there are more than one place in MimeMessageInputStreamSource using method of DeferredFileOutputStream.
If we use BufferedOutputStream, we have to flush buffer every time when the method from DeferredFileOutputStream
is used, I feel it's error-prone and messy


> Use buffered file output stream for MimeMessageInputStreamSource
> ----------------------------------------------------------------
>
>                 Key: JAMES-2343
>                 URL: https://issues.apache.org/jira/browse/JAMES-2343
>             Project: James Server
>          Issue Type: Improvement
>          Components: James Core
>            Reporter: TzeKai Lee
>            Priority: Major
>
> Currently MimeMessageInputStreamSource use DeferredFileOutputStream from commons-io which
does _not_ buffer output stream when switched to FileOutputStream. In my preliminary test,
simply wrap FileOutputStream with BufferedOutputStream could make a 50% performance improvement
for mail larger than deferring threshold (currently 100kb).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


Mime
View raw message