Commons Compress
  1. Commons Compress
  2. COMPRESS-83

GzipCompressorOutputStream should forward write(byte[] buf) and write(byte[] buf, int off, int len) to underlying stream

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1
    • Component/s: None
    • Labels:
      None
    • Environment:

      Linux

      Description

      Current version of GzipCompressorOutputStream decorates only write(int b) method for underlying java.zip.util.GZipOutputStream.

      In common scenario of:

      OutputStream os = ...;
      GzipCompressorOutputStream gcos = new GzipCompressorOutputStream(os);
      [do extensive write(byte[] buf]

      this results in very slow unbuffered write. This is particularly evident if the code changes to:

      OutputStream os = ...;
      GZIPOutputStream gos = new GZIPOutputStream(os);
      [do extensive write(byte[] buf]

      ...which is blazingly faster.

      In my environment, packing 100 Mb stream with Commons wrapper takes about 120 seconds, while using java.util.zip directly takes less than 1 second.
      This performance hit is way too bad for simple wrapper.

        Activity

        Hide
        Stefan Bodewig added a comment -

        fixed with svn revision 799917 - fixed input and output.

        Show
        Stefan Bodewig added a comment - fixed with svn revision 799917 - fixed input and output.
        Hide
        Aleksey Shipilev added a comment -

        Agree with the commit, closing the issue.

        Show
        Aleksey Shipilev added a comment - Agree with the commit, closing the issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Aleksey Shipilev
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development