Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ppkarwasz
Copy link
Contributor

Previously, sparse files were processed recursively. On highly fragmented files, this led to deep recursion and significant inefficiency.

This change replaces the recursive approach with an iterative strategy, which scales better for files with many fragments. It also introduces generated tests that simulate sparse files with very high fragmentation to ensure correctness and performance under stress.

Previously, sparse files were processed recursively. On highly fragmented files, this led to deep recursion and significant inefficiency.

This change replaces the recursive approach with an iterative strategy, which scales better for files with many fragments. It also introduces generated tests that simulate sparse files with very high fragmentation to ensure correctness and performance under stress.
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves sparse file handling performance by replacing a recursive approach with an iterative strategy that scales better for highly fragmented files. The change also introduces comprehensive test coverage to ensure correctness and performance under stress conditions with maximally fragmented sparse files.

Key changes:

  • Replaced recursive sparse file processing with iterative ComposedTarInputStream
  • Added comprehensive test suite with generated maximally fragmented sparse files
  • Improved error handling with more specific EOFException messages

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
TarArchiveInputStreamTest.java Updated exception assertions from ArchiveException to EOFException
SparseFilesTest.java Added parameterized tests for maximally fragmented sparse files
TestArchiveGenerator.java New utility class to generate sparse file test cases
BoundedArchiveInputStream.java Added input validation and improved documentation
ArchiveUtils.java Added checkFromIndexSize utility method for array bounds checking
TarFile.java Refactored sparse file handling to use ComposedTarInputStream
TarArchiveInputStream.java Replaced recursive sparse reading with iterative approach
ComposedTarInputStream.java New class implementing iterative sparse file reading

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

1 participant