Conversation
Updated to the latest headers fronm kuba
- Converted the C test suite from Kuba Zip to Kotlin - Switched the JVM implementation to zip4j because the built in JVM implementation packed Append functionality. This allowed the JVM impl to pass the whole test suite
Added performance tests to compare it against the C implementation
1. Streaming Read/Write: The implementation no longer loads the entire ZIP file or its entries into memory. It now uses a DataSource system to defer data access until the final write operation. 2. Random Access Seeking: I implemented platform-specific random-access seeking (openSourceAt) for JVM (using RandomAccessFile) and Native (using fseek). This eliminated the $O(N^2)$ overhead caused by Source.skip, which previously read and discarded data from the start of the file for every entry. 3. Optimized CRC32: Replaced the naive bit-by-bit CRC32 with a high-performance table-based implementation.
|
You are doing some amazing work. Thank you very much! iOS targets: The PR looks good and the idea of including the Test: Porting the tests from Kuba is also a great idea. Maybe this could be converted into a PR that is independent from the addition of iOS targets? Also the move to zip4j looks good. iirc a while back I looked at zip4j for similar reasons, which is why the dependency was still there. Pure Kotlin: Obviously the ideal solution regarding feature parity and portability. The main reason I did not do this in the past is because I do not feel comfortable maintaining the actual implementation for zip. But maybe this is something we can use for the web targets for now. |
|
closing this in favor of the more targets PRs |
Okay I realize this is a lot of PRs, but you can choose your own adventure here, they all stack on each other: