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

        Aleksey Shipilev created issue -
        Christian Grobmeier made changes -
        Field Original Value New Value
        Fix Version/s 1.1 [ 12313772 ]
        Stefan Bodewig made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Aleksey Shipilev made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          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