commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (IO-355) IOUtils copyLarge() and skip() methods are performance hogs
Date Tue, 16 Apr 2013 20:51:17 GMT

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

Sebb resolved IO-355.
---------------------

       Resolution: Fixed
    Fix Version/s: 2.5

The Javadoc has been updated to mention the possible slowness of the skip methods.

If the user wants to use the faster (but possibly inaccurate) skip method, they can do so
before calling copyLarge.
                
> IOUtils copyLarge() and skip() methods are performance hogs
> -----------------------------------------------------------
>
>                 Key: IO-355
>                 URL: https://issues.apache.org/jira/browse/IO-355
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.3, 2.4
>            Reporter: Uli Bubenheimer
>             Fix For: 2.5
>
>
> IOUtils.skip(InputStream, long) and IOUtils.skip(Reader, long) have the worst possible
performance as they always use read() on the input instead of using skip(). In many cases,
using skip() from a subclass of InputStream is much faster than read(), as the skip() can
be implemented via a disk seek.
> The IOUtils.skip() methods are also used in the copyLarge() methods that involve a skip.
> Case in point: I have observed this performance degradation with Java 7 on Windows 7.
A series of consecutive copyLarge() invocations on a large file on disk that involved skips
changed my performance from 30 secs as my baseline to 10 minutes after starting to use IOUtils.copyLarge().

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message