Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-355

IOUtils copyLarge() and skip() methods are performance hogs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3, 2.4
    • 2.5
    • Utilities
    • None

    Description

      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().

      Attachments

        Activity

          People

            Unassigned Unassigned
            apache.k.ulib@recursor.net Uli Bubenheimer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: