[jira] [Created] (IO-329) FileUtils.writeLines uses unbuffered IO

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (IO-329) FileUtils.writeLines uses unbuffered IO

Gary D. Gregory (Jira)
Vitalii Tymchyshyn created IO-329:
-------------------------------------

             Summary: FileUtils.writeLines uses unbuffered IO
                 Key: IO-329
                 URL: https://issues.apache.org/jira/browse/IO-329
             Project: Commons IO
          Issue Type: Bug
          Components: Streams/Writers
    Affects Versions: 2.3
            Reporter: Vitalii Tymchyshyn


FileUtils.writeLines looks like next:

 out = openOutputStream(file, append);
 IOUtils.writeLines(lines, lineEnding, out, encoding);

openOutputStream opens plain FileOutputStream without any buffering and IOUtils.writeLines does not add abyt buffering. This means each line require 2 write syscalls (one for the line and one for line separator). This makes call very slow, especially for short lines

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (IO-329) FileUtils.writeLines uses unbuffered IO

Gary D. Gregory (Jira)

     [ https://issues.apache.org/jira/browse/IO-329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory resolved IO-329.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.4

Committed revision 1343253.
               

> FileUtils.writeLines uses unbuffered IO
> ---------------------------------------
>
>                 Key: IO-329
>                 URL: https://issues.apache.org/jira/browse/IO-329
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Streams/Writers
>    Affects Versions: 2.3
>            Reporter: Vitalii Tymchyshyn
>             Fix For: 2.4
>
>
> FileUtils.writeLines looks like next:
>  out = openOutputStream(file, append);
>  IOUtils.writeLines(lines, lineEnding, out, encoding);
> openOutputStream opens plain FileOutputStream without any buffering and IOUtils.writeLines does not add abyt buffering. This means each line require 2 write syscalls (one for the line and one for line separator). This makes call very slow, especially for short lines

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira