FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Use `BufferedOutputStream` when writing the Zip file to improve performance by stuartwdouglas · Pull Request #1579 · GradleUp/shadow · GitHub

Use BufferedOutputStream when writing the Zip file to improve performance - #1579

Merged
Goooler merged 3 commits into
GradleUp:8.xfrom
stuartwdouglas:stuartwdouglas/buffered-writes
Aug 5, 2025
Merged

Goooler merged 3 commits into
GradleUp:8.xfrom
stuartwdouglas:stuartwdouglas/buffered-writes

Conversation

stuartwdouglas commented Aug 4, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

When not using STORED entries use a BufferedOutputStream to avoid lots of small writes to the file system.

Testing this with a 300mb jar build I see the total build time going from 40s to 30s.

Note that it is not possible to do this with STORED entries as the implementation requires a RandomAccessFile to update the CRC after write.


  • CHANGELOG's "Unreleased" section has been updated, if applicable.

When not using STORED entries use a BufferedOutputStream to avoid lots
of small writes to the file system.

Testing this with a 300mb jar build I see the total build time going
from 40s to 30s.

Note that it is not possible to do this with STORED entries as the
implementation requires a RandomAccessFile to update the CRC after
write.
stuartwdouglas force-pushed the stuartwdouglas/buffered-writes branch from c6d623a to 37b2918 Compare August 4, 2025 22:13
stuartwdouglas marked this pull request as draft August 4, 2025 22:22
stuartwdouglas marked this pull request as ready for review August 4, 2025 22:27
stuartwdouglas changed the title fix: use buffered writes for performance [8.x] fix: use buffered writes for performance Aug 4, 2025
Goooler requested a review from Copilot August 5, 2025 01:34

This comment was marked as outdated.

Goooler changed the title [8.x] fix: use buffered writes for performance Use buffered writes for performance Aug 5, 2025
Goooler changed the title Use buffered writes for performance Use buffered writes for ZipOutputStream to improve performance Aug 5, 2025
Goooler changed the title Use buffered writes for ZipOutputStream to improve performance Use BufferedOutputStream when writing the Zip file to improve performance Aug 5, 2025
Goooler requested a review from Copilot August 5, 2025 01:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull Request Overview

This PR improves ZIP file creation performance by using BufferedOutputStream for non-STORED compression methods. The change conditionally wraps the file output stream with a buffer to reduce system call overhead during ZIP file writing.

Key changes:

  • Modified DefaultZipCompressor to conditionally use BufferedOutputStream based on compression method
  • Added changelog entry documenting the performance improvement

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
DefaultZipCompressor.groovy Adds conditional buffering logic to improve ZIP writing performance for non-STORED entries
README.md Documents the performance improvement in the changelog

Goooler merged commit 218c78a into GradleUp:8.x Aug 5, 2025
dongjoon-hyun added a commit to apache/spark-kubernetes-operator that referenced this pull request Jan 20, 2026
### What changes were proposed in this pull request?

This PR aims to upgrade `com.gradleup.shadow` to 8.3.9.

### Why are the changes needed?

To bring the latest bug fixed versions.
- https://github.com/GradleUp/shadow/releases/tag/8.3.9
  - GradleUp/shadow#1579
- https://github.com/GradleUp/shadow/releases/tag/8.3.8
  - GradleUp/shadow#1493
  - GradleUp/shadow#1488
- https://github.com/GradleUp/shadow/releases/tag/8.3.7
  - GradleUp/shadow#1470

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the CIs.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #469 from dongjoon-hyun/SPARK-55102.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL